Loading…

How we can set Http Request Header in Angular 2 and Angular 4?

To set Http Request Header in Angular 2, create the HTTP Client Injectable class and inject the HttpClient object in the Component. Developers use HTTP Interceptors to set Http Request Header in Angular 4. To achieve this. Write an interceptor for adds a header for every request and after creating the interceptor, register it using HTTP_INTERCEPTORS in the @NgModule().

Suggest An Answer

No suggestions avaliable!

Latest post from Angular 4 Interview Questions

Ask Question