title: Interceptor not intercepting http POST requests (Angular 6)
body: <p>I have created an angular interceptor implementing the httpinterceptor. It is working fine for the http GET requests. But failing for POST requests.</p>
  
  <p>My interceptor code is as below.</p>
  
  <pre><code>import { Injectable, Injector } from '@angular/core';
  import { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest,         HttpHeaders,HttpResponse } from '@angular/common/http';
  
  import { Observable } from 'rxjs';
  
  @Injectable()
  export class MyHttpInterceptor implements HttpInterceptor {
    constructor() { console.log('enter constructor');
     }
  
    intercept(
      req: HttpRequest&lt;any&gt;,
      next: HttpHandler
    ): Observable&lt;HttpEvent&lt;any&gt;&gt; {
      console.log('entered interceptor')
      const token = localStorage.getItem('sessiontoken') != null ?     localStorage.getItem('sessiontoken') : 'notoken';
      const authReq = req.clone({ headers:     req.headers.set("Authorization", token) });
  
      return next.handle(authReq);
  
    }
  
  }
  </code></pre>
  
  <p>The module is added with provider.</p>
  
  <pre><code>providers: [
  {
    provide: HTTP_INTERCEPTORS,
    useValue: { disableClose: true, minWidth: 400, hasBackdrop: true },
    useClass: MyHttpInterceptor,
    multi: true
  }
  ]
  </code></pre>
  
  <p>in the component I have imported the httpClient and used this.http.post</p>
  
  <pre><code>import { HttpClient } from '@angular/common/http';
  </code></pre>