INetworkModule interface

用戶端網路介面用來發送後端請求。

方法

sendGetRequestAsync<T>(string, NetworkRequestOptions, number)

非同步網路「GET」請求的介面功能。 根據 Fetch 標準: https://fetch.spec.whatwg.org/

sendPostRequestAsync<T>(string, NetworkRequestOptions)

非同步網路「POST」請求的介面功能。 根據 Fetch 標準: https://fetch.spec.whatwg.org/

方法詳細資料

sendGetRequestAsync<T>(string, NetworkRequestOptions, number)

非同步網路「GET」請求的介面功能。 根據 Fetch 標準: https://fetch.spec.whatwg.org/

function sendGetRequestAsync<T>(url: string, options?: NetworkRequestOptions, timeout?: number): Promise<NetworkResponse<T>>

參數

url

string

timeout

number

傳回

Promise<NetworkResponse<T>>

sendPostRequestAsync<T>(string, NetworkRequestOptions)

非同步網路「POST」請求的介面功能。 根據 Fetch 標準: https://fetch.spec.whatwg.org/

function sendPostRequestAsync<T>(url: string, options?: NetworkRequestOptions): Promise<NetworkResponse<T>>

參數

url

string

傳回

Promise<NetworkResponse<T>>