HttpInterceptor
Intercepts HttpRequest
and handles them.
interface HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>
}
Description
Most interceptors will transform the outgoing request before passing it to the
next interceptor in the chain, by calling next.handle(transformedReq)
.
In rare cases, interceptors may wish to completely handle a request themselves, and not delegate to the remainder of the chain. This behavior is allowed.
Methods
Intercept an outgoing |
||||
Parameters
Returns
|
||||
Typically an interceptor will transform the outgoing request before returning
More rarely, an interceptor may choose to completely handle the request itself,
and compose a new event stream instead of invoking It is also rare but valid for an interceptor to return multiple responses on the event stream for a single request. |