DefaultHttpClient class
An HTTP client that uses node-fetch
.
Methods
fetch(string, Common |
Uses |
prepare |
Prepares a request based on the provided web resource. |
process |
Process an HTTP response. |
send |
Provides minimum viable error handling and the logic that executes the abstract methods. |
Method Details
fetch(string, CommonRequestInit)
Uses node-fetch
to perform the request.
function fetch(input: string, init?: CommonRequestInit): Promise<CommonResponse>
Parameters
- input
-
string
- init
- CommonRequestInit
Returns
Promise<CommonResponse>
prepareRequest(WebResourceLike)
Prepares a request based on the provided web resource.
function prepareRequest(httpRequest: WebResourceLike): Promise<Partial<RequestInit>>
Parameters
- httpRequest
- WebResourceLike
Returns
Promise<Partial<RequestInit>>
processRequest(HttpOperationResponse)
Process an HTTP response.
function processRequest(_operationResponse: HttpOperationResponse): Promise<void>
Parameters
- _operationResponse
- HttpOperationResponse
Returns
Promise<void>
sendRequest(WebResourceLike)
Provides minimum viable error handling and the logic that executes the abstract methods.
function sendRequest(httpRequest: WebResourceLike): Promise<HttpOperationResponse>
Parameters
- httpRequest
- WebResourceLike
Object representing the outgoing HTTP request.
Returns
Promise<HttpOperationResponse>
An object representing the incoming HTTP response.