@hellosirandy/rest-api-wrapper
2.0.2 • Public • Published @hellosirandy/rest-api-wrapper
$ npm install @hellosirandy/rest-api-wrapper
import API from '@hellosirandy/rest-api-wrapper';
const baseURL = 'https://example.com';
const api = API(baseURL);
const options = {
endpoint: '/test',
token: '123456-asdf', //option
params: {
foo: 'bar'
} //option
}
api.get(options)
const options = {
endpoint: '/test',
token: '123456-asdf', //option
body: {
foo: 'bar'
} //option
}
api.post(options)
const options = {
endpoint: '/test',
token: '123456-asdf', //option
body: {
foo: 'bar'
} //option
}
api.put(options)
const options = {
endpoint: '/test',
token: '123456-asdf', //option
}
api.delete(options)
Package Sidebar
Install
npm i @hellosirandy/rest-api-wrapper
Weekly Downloads