new HttpClient(endpoint)
Parameters:
| Name | Type | Description |
|---|---|---|
endpoint |
* |
- Source:
- features/httpClient.js
Methods
-
<async> do(method, path, query, body, options)
-
Parameters:
Name Type Description methodstring pathstring queryobject bodyobject optionsobject Request options
- Source:
- features/httpClient.js
Properties:
Name Type Argument Default Description options.httpMethodstring <optional>
Specified the http method to override the method argument
options.endpointstring <optional>
Specified the base endpoint for this request only
options.onSendfunction <optional>
Specified the onSend hook for this request only
options.timeoutinteger <optional>
Specified the timeout setting for this request only
options.headersobject <optional>
Specified the headers for this request only
options.withCredentialsboolean <optional>
Specified the withCredentials header for CORS
options.formDataobject <optional>
Specified the form fields
options.fileFieldobject <optional>
'file' Specified the file field name
options.fileNameobject <optional>
Specified the file name to override the file to upload
options.onProgressfunction <optional>
Specified the on progress callback
Returns:
- Type
- *
-
initReq(httpMethod, url)
-
Initialize a request instance
Parameters:
Name Type Description httpMethodstring urlstring - Source:
- features/httpClient.js
Returns:
- Type
- Request