Simple promisified http client to send requests
Send http request:
- POST
- GET
- PUT
- PATCH
- DELETE
- HEAD
- OPTIONS
npm install @sigfox/universal-api-client
const ApiClient = require('@sigfox/universal-api-client');
const apiClient = new ApiClient({ baseURL: '/api' });
const getData = client => client.get('/data');
const postData = (client, data) => client.post('/data', data);
getData(client).then(response => {
// use response here
});
postData(client, { lifePurpose: 42 }).then(response => {
// use response here
});
// and so on...
npm test
This project is licensed under the MIT License - see the LICENSE file for details.