次の方法で共有


DefaultHttpClient class

node-fetchを使用する HTTP クライアント。

メソッド

fetch(string, CommonRequestInit)

node-fetch を使用して要求を実行します。

prepareRequest(WebResourceLike)

指定された Web リソースに基づいて要求を準備します。

processRequest(HttpOperationResponse)

HTTP 応答を処理します。

sendRequest(WebResourceLike)

実行可能な最小限のエラー処理と、抽象メソッドを実行するロジックを提供します。

メソッドの詳細

fetch(string, CommonRequestInit)

node-fetch を使用して要求を実行します。

function fetch(input: string, init?: CommonRequestInit): Promise<CommonResponse>

パラメーター

input

string

戻り値

Promise<CommonResponse>

prepareRequest(WebResourceLike)

指定された Web リソースに基づいて要求を準備します。

function prepareRequest(httpRequest: WebResourceLike): Promise<Partial<RequestInit>>

パラメーター

httpRequest
WebResourceLike

戻り値

Promise<Partial<RequestInit>>

processRequest(HttpOperationResponse)

HTTP 応答を処理します。

function processRequest(_operationResponse: HttpOperationResponse): Promise<void>

パラメーター

_operationResponse
HttpOperationResponse

戻り値

Promise<void>

sendRequest(WebResourceLike)

実行可能な最小限のエラー処理と、抽象メソッドを実行するロジックを提供します。

function sendRequest(httpRequest: WebResourceLike): Promise<HttpOperationResponse>

パラメーター

httpRequest
WebResourceLike

送信 HTTP 要求を表すオブジェクト。

戻り値

受信 HTTP 応答を表すオブジェクト。