a4-http-header-interceptor
v9.0.0
Published
Inject custom http headers globally into all http calls
Readme
a4-http-header-interceptor
Angular 7 Http Header Interceptor
How-To
Install
npm install a4-http-header-interceptorapp.module.ts
- Add
HttpModuleto imports of theapp.module.ts.
...
import { HttpHeaderModule } from 'a4-http-header-interceptor';
...
@NgModule({
declarations: [
AppComponent
],
imports: [
...,
HttpHeaderModule,
...
],
...
})Inject the service
constructor(private httpHeaderService: HttpHeaderService) { }Inject custom header to every http client operations
this.httpHeaderService.setHeader('key','value');