@univerjs/network v0.5.0-beta.1Docs


Class: HTTPService

This service provides http request methods and allows to register http interceptors.

You can use interceptors to:

  1. modify requests (headers included) before they are sent, or modify responses before they are returned to the caller.
  2. threshold, logging, caching, etc.
  3. authentication, authorization, etc.

Extends

Constructors

new HTTPService()

new HTTPService(_http): HTTPService

Parameters

ParameterType
_httpIHTTPImplementation

Returns

HTTPService

Overrides

Disposable.constructor

Defined in

submodules/univer/packages/network/src/services/http/http.service.ts:81

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:93

Methods

delete()

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

Type Parameters

Type Parameter
T

Parameters

ParameterType
urlstring
params?IRequestParams

Returns

Promise<HTTPEvent<T>>

Defined in

submodules/univer/packages/network/src/services/http/http.service.ts:116


dispose()

dispose(): void

Returns

void

Inherited from

Disposable.dispose

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:106


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:96


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:100


get()

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

Type Parameters

Type Parameter
T

Parameters

ParameterType
urlstring
params?IRequestParams

Returns

Promise<HTTPEvent<T>>

Defined in

submodules/univer/packages/network/src/services/http/http.service.ts:104


getSSE()

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

Type Parameters

Type Parameter
T

Parameters

ParameterType
methodHTTPRequestMethod
urlstring
options?IPostRequestParams

Returns

Observable<HTTPEvent<T>>

Defined in

submodules/univer/packages/network/src/services/http/http.service.ts:124


patch()

patch<T>(url, options?): Promise<HTTPEvent<T>>

Type Parameters

Type Parameter
T

Parameters

ParameterType
urlstring
options?IPostRequestParams

Returns

Promise<HTTPEvent<T>>

Defined in

submodules/univer/packages/network/src/services/http/http.service.ts:120


post()

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

Type Parameters

Type Parameter
T

Parameters

ParameterType
urlstring
params?IPostRequestParams

Returns

Promise<HTTPEvent<T>>

Defined in

submodules/univer/packages/network/src/services/http/http.service.ts:108


put()

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

Type Parameters

Type Parameter
T

Parameters

ParameterType
urlstring
params?IPostRequestParams

Returns

Promise<HTTPEvent<T>>

Defined in

submodules/univer/packages/network/src/services/http/http.service.ts:112


registerHTTPInterceptor()

registerHTTPInterceptor(interceptor): IDisposable

Register an HTTP interceptor.

Parameters

ParameterTypeDescription
interceptorIHTTPInterceptorthe http interceptor

Returns

IDisposable

a disposable handler to remove the interceptor

Defined in

submodules/univer/packages/network/src/services/http/http.service.ts:91