API Reference
@univerjs
@univerjs/network
type-aliases
Httpinterceptorfn

@univerjs/network v0.1.17Docs


Type Alias: HTTPInterceptorFn()

type HTTPInterceptorFn: (request, next) => Observable<HTTPEvent<unknown>>;

Parameters

ParameterTypeDescription
requestHTTPRequestThe request could be been modified by interceptors whose priority is higher than the current interceptor.
nextHTTPHandlerFnWhen 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)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.