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

1.0.2 • Public • Published

A library for working with JSON REST APIs. This function creates a REST API client that can be used to make requests to the specified URL. It returns an object with methods for making GET, POST, PUT, PATCH, and DELETE requests.

Examples:

const api = createRestAPI('https://api.example.com');
const data = await api.get('/users').send();
const user = await api.post('/users').body({ name: 'Alice' }).send();
const user = await api.post('/users').send({ name: 'Alice' });
await api.delete('/users').query({ id: 123 }).send();

Readme

Keywords

none

Package Sidebar

Install

npm i @dabble/rest-client

Weekly Downloads

40

Version

1.0.2

License

MIT

Unpacked Size

19.9 kB

Total Files

14

Last publish

Collaborators

  • jacwright
  • matalina
  • ryanhavoc