@univerjs/network v0.5.4


Class: HTTPService

Defined in: submodules/univer/packages/network/src/services/http/http.service.ts:74

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

Defined in: submodules/univer/packages/network/src/services/http/http.service.ts:80

Parameters

ParameterType
_httpIHTTPImplementation

Returns

HTTPService

Overrides

Disposable.constructor

Properties

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

Methods

delete()

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

Defined in: submodules/univer/packages/network/src/services/http/http.service.ts:115

Type Parameters

Type Parameter
T

Parameters

ParameterType
urlstring
params?IRequestParams

Returns

Promise<HTTPEvent<T>>


dispose()

dispose(): void

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:109

Returns

void

Inherited from

Disposable.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

Disposable.ensureNotDisposed


get()

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

Defined in: submodules/univer/packages/network/src/services/http/http.service.ts:103

Type Parameters

Type Parameter
T

Parameters

ParameterType
urlstring
params?IRequestParams

Returns

Promise<HTTPEvent<T>>


getSSE()

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

Defined in: submodules/univer/packages/network/src/services/http/http.service.ts:123

Type Parameters

Type Parameter
T

Parameters

ParameterType
methodHTTPRequestMethod
urlstring
_params?IPostRequestParams

Returns

Observable<HTTPEvent<T>>


patch()

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

Defined in: submodules/univer/packages/network/src/services/http/http.service.ts:119

Type Parameters

Type Parameter
T

Parameters

ParameterType
urlstring
params?IPostRequestParams

Returns

Promise<HTTPEvent<T>>


post()

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

Defined in: submodules/univer/packages/network/src/services/http/http.service.ts:107

Type Parameters

Type Parameter
T

Parameters

ParameterType
urlstring
params?IPostRequestParams

Returns

Promise<HTTPEvent<T>>


put()

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

Defined in: submodules/univer/packages/network/src/services/http/http.service.ts:111

Type Parameters

Type Parameter
T

Parameters

ParameterType
urlstring
params?IPostRequestParams

Returns

Promise<HTTPEvent<T>>


registerHTTPInterceptor()

registerHTTPInterceptor(interceptor): IDisposable

Defined in: submodules/univer/packages/network/src/services/http/http.service.ts:90

Register an HTTP interceptor.

Parameters

ParameterTypeDescription
interceptorIHTTPInterceptorthe http interceptor

Returns

IDisposable

a disposable handler to remove the interceptor