@univerjs/network v0.5.0-beta.1 • Docs
Class: HTTPService
This service provides http request methods and allows to register http interceptors.
You can use interceptors to:
- modify requests (headers included) before they are sent, or modify responses before they are returned to the caller.
- threshold, logging, caching, etc.
- authentication, authorization, etc.
Extends
Constructors
new HTTPService()
new HTTPService(_http): HTTPService
Parameters
Parameter | Type |
---|---|
_http | IHTTPImplementation |
Returns
Overrides
Defined in
submodules/univer/packages/network/src/services/http/http.service.ts:81
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:93 |
Methods
delete()
delete<T>(url, params?): Promise<HTTPEvent<T>>
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
url | string |
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
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:106
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:96
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
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
Parameter | Type |
---|---|
url | string |
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
Parameter | Type |
---|---|
method | HTTPRequestMethod |
url | string |
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
Parameter | Type |
---|---|
url | string |
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
Parameter | Type |
---|---|
url | string |
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
Parameter | Type |
---|---|
url | string |
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
Parameter | Type | Description |
---|---|---|
interceptor | IHTTPInterceptor | the http interceptor |
Returns
a disposable handler to remove the interceptor
Defined in
submodules/univer/packages/network/src/services/http/http.service.ts:91