title: Angular 5 - Can't set header for HttpClient
body: <p>I am trying to make a POST call using <code>HttpClient</code> in an Angular 5 project, and I want to set the header:</p>
  
  <pre><code>import { HttpClient, HttpHeaders, HttpRequest } from '@angular/common/http';
  import { Injectable } from '@angular/core';
  
  import { AuthData }    from './models/auth-data';
  
  @Injectable()
  export class AuthService {
  
      constructor(private http: HttpClient) { }
  
      auth = (data: AuthData) =&gt; {
  
          var url = "https://.../login";
          var payload = data;
          var headers = new HttpHeaders().set('Content-Type', 'application/json; charset=utf-8');
          var options =  {
              headers: headers
          };
  
          this.http.post(url, payload, options).subscribe();
      }
  }
  </code></pre>
  
  <p>For some reason, the <code>Content-Type</code> header does not seem to be in the request I am making.</p>
  
  <p><a href="https://i.stack.imgur.com/1iv8M.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1iv8M.png" alt="enter image description here"></a></p>
  
  <p>Why is this?</p>