This package has been deprecated

Author message:

This package is deprecated. Please use '@thaitype/rest-client' instead.

@mild-ts/rest-client
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

@mild-ts/rest-client

Lightweight REST client helper function wrapping with type and Axios

CI

Introduction

Lightweight REST client helper function with basic type support and Axios wrapper. However, if you need more type-safety, we recommend considering untypeable.

Alternatively, if you have control over both the server and client types, options like tRPC or GraphQL are great choices. So go ahead and choose the option that works best for your needs!

Installation

npm i @mild-ts/rest-client

Examples

import { RestClient } from '@mild-ts/rest-client';

async function main() {
  const client = new RestClient();
  const res = await client.request('GET https://jsonplaceholder.typicode.com/posts/{postId}/comments', {
    params: {
      postId: 1,
    },
  });
  console.log(res.data);
}

main();

API

to be add later

Readme

Keywords

none

Package Sidebar

Install

npm i @mild-ts/rest-client

Weekly Downloads

0

Version

0.4.0

License

MIT

Unpacked Size

37 kB

Total Files

13

Last publish

Collaborators

  • mildronize