Siddharth Gajbhiye
What is HTTP Intrerceptor in Angular ?

Hi Everyone ,

I one of my interviews i was asked by the interveiwer what exactly is Http Interceptor in Angular ?

By Siddharth Gajbhiye in Angular on Sep 13 2019
  • Laxmidhar Sahoo
    Dec, 2019 21

    In the world of Angular, interceptors have been used to pre-process and post-process the HTTP request before sending and after getting response from the server. Interceptors can be used in two different phases in a life cycle of an HTTP request to a server, which are:

    1. Before making the request server: This happens before the call is made to server. It can be used change the request configuration of HTTP call. The most common use case for this is to add an Access Token to be sent to the server with each HTTP request so that it can be validated at server end.
    1. After Getting the response from server: This happens once we get the response from the server. It can be used change the response before it is being passed to the code block from where HTTP call was made. The most common use case for this is to Handle Global Error Handling across the app.

    • 1
  • Rupesh Kahane
    Oct, 2019 30


Most Popular Job Functions


MOST LIKED QUESTIONS