Methods
request(method, url, authopt, bodyopt, fileopt) → {Promise.<Object>}
Make an API request
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
method |
String
|
Uppercase HTTP method |
||||||||||
url |
String
|
URL of the endpoint |
||||||||||
auth |
Boolean
|
<optional> |
Whether to add the Authorization header and token or not |
|||||||||
body |
Object
|
<optional> |
Request payload |
|||||||||
file |
Object
|
<optional> |
File object
|
Returns:
- Type:
-
Promise.<Object>
Resolves with the returned JSON data