Class: HttpClient

Feature_HttpClient~ HttpClient

HTTP client.


new HttpClient(endpoint)

Parameters:
Name Type Description
endpoint *
Source:
features/httpClient.js

Methods


<async> do(method, path, query, body, options)

Parameters:
Name Type Description
method string
path string
query object
body object
options object

Request options

Properties:
Name Type Argument Default Description
options.httpMethod string <optional>

Specified the http method to override the method argument

options.endpoint string <optional>

Specified the base endpoint for this request only

options.onSend function <optional>

Specified the onSend hook for this request only

options.timeout integer <optional>

Specified the timeout setting for this request only

options.headers object <optional>

Specified the headers for this request only

options.withCredentials boolean <optional>

Specified the withCredentials header for CORS

options.formData object <optional>

Specified the form fields

options.fileField object <optional>
'file'

Specified the file field name

options.fileName object <optional>

Specified the file name to override the file to upload

options.onProgress function <optional>

Specified the on progress callback

Source:
features/httpClient.js
Returns:
Type
*

initReq(httpMethod, url)

Initialize a request instance

Parameters:
Name Type Description
httpMethod string
url string
Source:
features/httpClient.js
Returns:
Type
Request