@trenskow/request
v1.0.68
Published
A small request library for usage with APIs that uses the `@trenskow/api-error` package.
Downloads
336
Readme
@trenskow/request
A small request library for usage with APIs that uses the @trenskow/api-error
package.
It is based of Axios.
Usage
const request = require('@trenskow/request');
await request('https://api.mysite.com', { /* options */ }).get('/my/resource', { /* options */});
Supported methods:
get
,post
,put
,delete
andoptions
.
Options
| Name | Type | Description |
|:----------|:--------:|:-----------------------------------|
| headers
| Object
| Custom headers for the request(s). |
| payload
| Any | Whatever Axios supports. |
| query
| Object
| Object with keys and values. |
LICENSE
See LICENSE