@univerjs/network v0.4.2 • Docs
Type Alias: HTTPInterceptorFn()
type HTTPInterceptorFn: (request, next) => Observable<HTTPEvent<unknown>>;
Parameters
Parameter | Type | Description |
---|---|---|
request | HTTPRequest | The request could be been modified by interceptors whose priority is higher than the current interceptor. |
next | HTTPHandlerFn | When the interceptor decides to pass the request to the next interceptor, it should call the next function with the request. The next function would return an Observable . The current interceptor should subscribe to it and emit the messages from next interceptor to the previous interceptor. |
Returns
Observable
<HTTPEvent
<unknown
>>
An Observable
that emits the response of the request. It would be subscribed by the previous interceptor.
An interceptor the logs the request and response would look like this:
Defined in
packages/network/src/services/http/interceptor.ts:43 (opens in a new tab)