Methods
undefinedapiCall(options) → {Promise}
Method that will perform a request.
Parameters:
Name |
Type |
Description |
options |
Object
|
Properties
Name |
Type |
Attributes |
Default |
Description |
uri |
string
|
<optional>
|
|
Valid uri, or relative uri to apiBaseUrl |
priority |
boolean
|
<optional>
|
|
If API call needs to skip rate limited and throttled queue |
retryOnFail |
boolean
|
<optional>
|
|
When API call fails, retry once |
ignoreError |
boolean
|
<optional>
|
|
When API call fails, do not call webApiErrorHandler (prevent loops) |
method |
string
|
<optional>
|
|
GET, POST, PUT, DELETE |
json |
boolean
|
<optional>
|
true
|
Parse response as JSON |
headers |
Object
|
<optional>
|
|
Headers to be added to the request (will merge with default headers) |
omitAuthorizationHeader |
boolean
|
<optional>
|
|
Omit Authorization header (e.g. for refreshing) |
|
Returns:
-
Type
-
Promise
undefinedapiCallDel(options) → {Promise}
Method that will perform a DEL request.
Parameters:
Name |
Type |
Description |
options |
Object
|
Properties
Name |
Type |
Attributes |
Default |
Description |
uri |
string
|
<optional>
|
|
Valid uri, or relative uri to apiBaseUrl |
priority |
boolean
|
<optional>
|
|
If API call needs to skip rate limited and throttled queue |
retryOnFail |
boolean
|
<optional>
|
|
When API call fails, retry once |
json |
boolean
|
<optional>
|
true
|
Parse response as JSON |
headers |
Object
|
<optional>
|
|
Headers to be added to the request (will merge with default headers) |
|
Returns:
-
Type
-
Promise
undefinedapiCallGet(options) → {Promise}
Method that will perform a GET request.
Parameters:
Name |
Type |
Description |
options |
Object
|
Properties
Name |
Type |
Attributes |
Default |
Description |
uri |
string
|
<optional>
|
|
Valid uri, or relative uri to apiBaseUrl |
priority |
boolean
|
<optional>
|
|
If API call needs to skip rate limited and throttled queue |
json |
boolean
|
<optional>
|
true
|
Parse response as JSON |
headers |
Object
|
<optional>
|
|
Headers to be added to the request (will merge with default headers) |
|
Returns:
-
Type
-
Promise
undefinedapiCallPost(options, data) → {Promise}
Method that will perform a POST request.
Parameters:
Name |
Type |
Description |
options |
Object
|
Properties
Name |
Type |
Attributes |
Description |
uri |
string
|
<optional>
|
Valid uri, or relative uri to apiBaseUrl |
priority |
boolean
|
<optional>
|
If API call needs to skip rate limited and throttled queue |
retryOnFail |
boolean
|
<optional>
|
When API call fails, retry once |
headers |
Object
|
<optional>
|
Headers to be added to the request (will merge with default headers) |
|
data |
Object
|
JSON data to POST |
Returns:
-
Type
-
Promise
undefinedapiCallPut(options, data) → {Promise}
Method that will perform a PUT request.
Parameters:
Name |
Type |
Description |
options |
Object
|
Properties
Name |
Type |
Attributes |
Description |
uri |
string
|
<optional>
|
Valid uri, or relative uri to apiBaseUrl |
priority |
boolean
|
<optional>
|
If API call needs to skip rate limited and throttled queue |
retryOnFail |
boolean
|
<optional>
|
When API call fails, retry once |
headers |
Object
|
<optional>
|
Headers to be added to the request (will merge with default headers) |
|
data |
Object
|
JSON data to POST |
Returns:
-
Type
-
Promise
undefinedsetDefaultBaseUrl(baseUrl)
Method that sets a default base ur.
Parameters:
Name |
Type |
Description |
baseUrl |
string
|
Base url, e.g.; http://example.api.com/ |
Method that sets a default header on the request object. Useful for setting authorization headers.
Parameters:
Name |
Type |
Description |
headerObj |
Object
|
Object that will be set as default headers property |