new HttpApi(conn, optionsopt)
HTTP based API class with authorization hook
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
conn |
Connection | Connection object | |||||||||||||||||
options |
Object |
<optional> |
Http API Options
Properties
|
- Source:
Extends
- events.EventEmitter
Members
(static) SessionRefreshDelegate
- Source:
Methods
(protected) beforeSend()
- Source:
(protected) getError()
Get error message in response
- Source:
(protected) getRefreshDelegate()
- Source:
(protected) getResponseBody()
Get response body
- Source:
(protected) getResponseContentType()
Detect response content mime-type
- Source:
(protected) hasErrorInResponseBody()
Detect error in response body
- Source:
(protected) isErrorResponse()
Detect error response
- Source:
(protected) isSessionExpired()
Detect session expiry
- Source:
(protected) parseError()
Parsing error message in response
- Source:
parseResponseBody()
- Source:
request(request, callback) → {Promise.<Object>}
Callout to API endpoint using http
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object | Http Request object
Properties
|
||||||||||||||||
callback |
Callback.<Object> | Callback function |
- Source:
Returns:
-
- Type
- Promise.<Object>