Module: helpers

HTTP wrapper functions module.
Author:
  • HackerBay, Inc.
Source:
See:

Members

(inner, constant) headers

The request headers.
Source:

Methods

(inner) defaultErrorHandler()

Handle request error.
Parameters:
Type Description
Object The error object of the request.
Source:

(inner) get(apiUrl, url, key, success, error) → {Promise}

Get request data with axios.
Parameters:
Name Type Description
apiUrl string The url of the api.
url string The endpoint of the request.
key string The api key of the endpoint.
success function The request success callback.
error function The request error callback.
Source:
Returns:
The request promise.
Type
Promise

(inner) post(apiUrl, url, data, key, success, error) → {Promise}

Post request data with axios.
Parameters:
Name Type Description
apiUrl string The url of the api.
url string The endpoint of the request.
data Object The data of endpoint.
key string The api key of the endpoint.
success function The request success callback.
error function The request error callback.
Source:
Returns:
The request promise.
Type
Promise