Skip to Content
ClassesFNetwork

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

ParameterTypeDescription
urlstringThe requested URL
params?IRequestParamsQuery 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

ParameterTypeDescription
urlstringThe requested URL.
params?IRequestParamsQuery 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

ParameterTypeDescription
methodHTTPRequestMethodHTTP request method
urlstringThe requested URL
params?IPostRequestParamsparams 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

ParameterTypeDescription
urlstringThe requested URL
params?IPostRequestParamsQuery 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

ParameterTypeDescription
urlstringThe requested URL.
params?IPostRequestParamsQuery 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

ParameterTypeDescription
urlstringThe requested URL
params?IPostRequestParamsQuery parameters

Returns

Promise<HTTPResponse<…>>

Network response