Skip to Content
ClassesFNetwork

类: FNetwork

This Facade provides a set of methods to make HTTP requests. You should not create an instance of this class directly, instead, use getNetwork of FUniver instead.

继承

  • FBase

方法

delete()

delete<T>(url, params?): Promise<HTTPResponse<...>>

Send DELETE request to the server.

类型参数

类型参数
T

参数

参数类型描述
urlstringThe requested URL
params?IRequestParamsQuery parameters

返回

Promise<HTTPResponse<…>>

Network response


get()

get<T>(url, params?): Promise<HTTPResponse<...>>

Send a GET request to the server.

类型参数

类型参数
T

参数

参数类型描述
urlstringThe requested URL.
params?IRequestParamsQuery parameters.

返回

Promise<HTTPResponse<…>>

Network response.


getSSE()

getSSE<T>( method, url, params?): Observable<HTTPEvent<...>>

Request for a stream of server-sent events. Instead of a single response, the server sends a stream of responses, Univer wraps the stream in an Observable which you can call subscribe on.

类型参数

类型参数
T

参数

参数类型描述
methodHTTPRequestMethodHTTP request method
urlstringThe requested URL
params?IPostRequestParamsparams Query parameters

返回

Observable<HTTPEvent<…>>

An observable that emits the network response.


patch()

patch<T>(url, params?): Promise<HTTPResponse<...>>

Send PATCH request to the server.

类型参数

类型参数
T

参数

参数类型描述
urlstringThe requested URL
params?IPostRequestParamsQuery parameters

返回

Promise<HTTPResponse<…>>

Network response


post()

post<T>(url, params?): Promise<HTTPResponse<...>>

Send a POST request to the server.

类型参数

类型参数
T

参数

参数类型描述
urlstringThe requested URL.
params?IPostRequestParamsQuery parameters.

返回

Promise<HTTPResponse<…>>

Network response.


put()

put<T>(url, params?): Promise<HTTPResponse<...>>

Send a PUT request to the server.

类型参数

类型参数
T

参数

参数类型描述
urlstringThe requested URL
params?IPostRequestParamsQuery parameters

返回

Promise<HTTPResponse<…>>

Network response