Class: 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.
Extends
FBase
Methods
delete()
delete<T>(url, params?): Promise<HTTPResponse<...>>
Send DELETE request to the server.
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
url | string | The requested URL |
params ? | IRequestParams | Query parameters |
Returns
Promise
<HTTPResponse
<…>>
Network response
get()
get<T>(url, params?): Promise<HTTPResponse<...>>
Send a GET request to the server.
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
url | string | The requested URL. |
params ? | IRequestParams | Query parameters. |
Returns
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.
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
method | HTTPRequestMethod | HTTP request method |
url | string | The requested URL |
params ? | IPostRequestParams | params Query parameters |
Returns
Observable
<HTTPEvent
<…>>
An observable that emits the network response.
patch()
patch<T>(url, params?): Promise<HTTPResponse<...>>
Send PATCH request to the server.
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
url | string | The requested URL |
params ? | IPostRequestParams | Query parameters |
Returns
Promise
<HTTPResponse
<…>>
Network response
post()
post<T>(url, params?): Promise<HTTPResponse<...>>
Send a POST request to the server.
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
url | string | The requested URL. |
params ? | IPostRequestParams | Query parameters. |
Returns
Promise
<HTTPResponse
<…>>
Network response.
put()
put<T>(url, params?): Promise<HTTPResponse<...>>
Send a PUT request to the server.
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
url | string | The requested URL |
params ? | IPostRequestParams | Query parameters |
Returns
Promise
<HTTPResponse
<…>>
Network response