INetworkModule interface
用于发送后端请求的客户端网络接口。
方法
| send |
异步网络“GET”请求的接口函数。 基于 Fetch 标准: https://fetch.spec.whatwg.org/ |
| send |
异步网络“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
- options
- NetworkRequestOptions
- 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
- options
- NetworkRequestOptions
返回
Promise<NetworkResponse<T>>