title: Angular 6: Unable to set Content-Type of http Header correctly
body: <p>I'm trying to make a post call using HttpHeader in angular 6 And I set Content-Type to application/json.
  But the server get x-www-form-urlencoded instead of application/json for Content-Type.</p>
  
  <p>service.ts
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>   
  myFunction(id: string, name: string, fields: string[]) {
    const body = {
      id: id,
      name: name,
      fields: fields
    };
    let headers = new HttpHeaders();
    headers= headers.set('content-type', 'application/json');
    return this.http.post(this.URL , body, {headers});
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>component.ts</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>submit(){
    this.myService.myFunction(this.id, this.form.value.name,  
    this.form.value.fields).subscribe((res:any) =&gt; {
      console.log(this.form);
    }, error =&gt; {
      console.log(JSON.parse(error.error).errors);
    })
  }</code></pre>
  </div>
  </div>
  </p>