Class: Requester

Requester() → {Requester}

Class for internal API requests

Constructor

new Requester() → {Requester}

Creates the internal requester
Properties:
Name Type Description
userAgent String The useragent used to make requests.
Source:
Returns:
A Requester instance
Type
Requester

Methods

get(endpoint, payloadOptions, withKey, ratelimit, castType) → {Promise.<(Array.<Object>|Any)>}

Gets data from an API endpoint.
Parameters:
Name Type Description
endpoint String The endpoint to get the data from.
payloadOptions Object An object of options to be used as the query string.
withKey Boolean To use the API key defined in the parent client or not.
ratelimit Boolean Ratelimit the request on the main bucket if ratelimiting is enabled.
castType Any "Cast" the elements of the array to the certain type.
Source:
Returns:
The returned object array from the API or Type[] as defined in castType.
Type
Promise.<(Array.<Object>|Any)>