2.0.2 • Published 5 years ago
@hellosirandy/rest-api-wrapper v2.0.2
@hellosirandy/rest-api-wrapper
Install
$ npm install @hellosirandy/rest-api-wrapper
Usage
Initialize
import API from '@hellosirandy/rest-api-wrapper';
const baseURL = 'https://example.com';
const api = API(baseURL);
Get
const options = {
endpoint: '/test',
token: '123456-asdf', //option
params: {
foo: 'bar'
} //option
}
api.get(options)
Post
const options = {
endpoint: '/test',
token: '123456-asdf', //option
body: {
foo: 'bar'
} //option
}
api.post(options)
Put
const options = {
endpoint: '/test',
token: '123456-asdf', //option
body: {
foo: 'bar'
} //option
}
api.put(options)
Delete
const options = {
endpoint: '/test',
token: '123456-asdf', //option
}
api.delete(options)
2.0.2
5 years ago
2.0.1
5 years ago
1.7.1
5 years ago
1.7.0
5 years ago
1.6.0
5 years ago
1.5.0
5 years ago
1.4.1
5 years ago
1.5.1
5 years ago
1.4.0
5 years ago
1.3.0
5 years ago
3.2.1
6 years ago
3.2.0
6 years ago
3.1.1
6 years ago
3.1.0
6 years ago
3.0.0
6 years ago
2.1.0
6 years ago
2.0.0
6 years ago
1.2.0
6 years ago
1.1.0
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago