Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

HttpHandlerFn

Represents the next interceptor in an interceptor chain, or the real backend if there are no further interceptors.

See more...

      
      type HttpHandlerFn = (req: HttpRequest<unknown>) => Observable<HttpEvent<unknown>>;
    

See also

Description

Most interceptors will delegate to this function, and either modify the outgoing request or the response when it arrives. Within the scope of the current request, however, this function may be called any number of times, for any number of downstream requests. Such downstream requests need not be to the same URL or even the same origin as the current request. It is also valid to not call the downstream handler at all, and process the current request entirely within the interceptor.

This function should only be called within the scope of the request that's currently being intercepted. Once that request is complete, this downstream handler function should not be called.