DefaultHttpClient class

An HTTP client that uses node-fetch.

Methods

fetch(string, CommonRequestInit)

Uses node-fetch to perform the request.

prepareRequest(WebResourceLike)

Prepares a request based on the provided web resource.

processRequest(HttpOperationResponse)

Process an HTTP response.

sendRequest(WebResourceLike)

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

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

An object representing the incoming HTTP response.