Creates an instance of AbstractRestClient.
representing connection to this api
Last byte received when response is being streamed
Bytes received from the server response so far
Contains REST chucks
If we get a response containing a Content-Encoding header, and it matches an encoding type that we recognize, it is saved here
If we get a response containing a Content-Length header, it is saved here
Contains buffered data after all REST chucks are received
Whether or not to try and decode any encoded response
Indicates if payload data is JSON to be stringified before writing
Instance of logger
Indicates if request data should have its newlines normalized to /n before sending each chunk to the server
Indicates if response data should have its newlines normalized for the current platform (\r\n for windows, otherwise \n)
Reject for errors when obtaining data
Save req headers
Save request
stream for outgoing request data to the server
Resolved when all data has been obtained
Save resource
Contain response from http(s) request
Stream for incoming response data from the server. If specified, response data will not be buffered
representing connection to this api
Task used to display progress bars or other user feedback mechanisms Automatically updated if task is specified and streams are provided for upload/download
Save write data
Return http(s) response body as a buffer
Return http(s) response body as a string
Return the logger object for ease of reference
Return whether or not a REST request was successful by HTTP status code
Return whether or not a REST request was successful by HTTP status code
Return http(s) response object
Return this session object
Append specific headers for all requests by overriding this implementation
list of headers
Appends output headers to the http(s) request
partially populated options objects
Build http(s) options based upon session settings and request.
URI for this request
REST request type GET|PUT|POST|DELETE
option headers to include with request
Method to accumulate and buffer http request response data until our onEnd method is invoked, at which point all response data has been accounted for. NOTE(Kelosky): this method may be invoked multiple times.
any datatype and content
Method that must be implemented to extend the IRestClient class. This is the client specific implementation for what action to perform after all response data has been collected.
Construct a throwable rest client error with all "relevant" diagnostic information. The caller should have the session, so not all input fields are present on the error response. Only the set required to understand "what may have gone wrong".
The "exit" point for the implementation error override will also be called here. The implementation can choose to transform the IImperativeError details however they see fit.
The base request error. It is expected to already have msg, causeErrors, and the error source pre-populated.
Process and customize errors encountered in your client. This is called any time an error is thrown from a failed Rest request using this client. error before receiving any response body from the API. You can use this, for example, to set the error tag for you client or add additional details to the error message. If you return null or undefined, Imperative will use the default error generated for your failed request.
the error encountered by the client
processedError - the error with the fields set the way you want them
Perform the actual http REST call with appropriate user input
Callback from http(s).request
https response
Determine whether we should stringify or leave writable data alone
options containing populated headers
Generated using TypeDoc
Class to handle http(s) requests, build headers, collect data, report status codes, and header responses and passes control to session object for maintaining connection information (tokens, checking for timeout, etc...)