title: Angular 4 Setting Headers with HttpClient Module
body: <p>im new with Angular and i'm working on a project that for some reasons i have to set headers for server side authorization, Im using Angular 4 and the HttpClient Module imported from '@angular/common/http'</p>
  
  <p>This is my AuthService Class</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { User } from '../../models/user';
  import { HttpClient, HttpHeaders, HttpRequest } from 
  '@angular/common/http';
  import { Observable } from 'rxjs';
  import { Globals } from '../../utils/global';
  import { Converters } from '../../utils/converters';
  
  
  @Injectable()
  export class AuthService {
  getUserByToken(token: string): any {
      let headers = new HttpHeaders();
      headers.append('Content-Type', 'application/json');
      headers.append('authorization', 'Bearer ' + token);
  
      console.log(headers);
  
      return new Promise((resolve, reject) =&gt; {
        this.http.get(this.global.urls['info'], { headers: headers }).subscribe((data) =&gt; {
          if (data != null) {
            this.converter.userJsonToObject(data).then((data: User) =&gt; {
              this.setCurrentUser(data);
              this.persistToken(data.token);
              resolve(data);
            });
          } else {
            reject('This user is not defined');
          }
        }, (err) =&gt; {
          reject(err);
        });
      });
  
    }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/QcQwL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/QcQwL.png" alt="ARC"></a></p>
  
  <p>When i run my project and i call getUserByToken(token) function, the server console told me that no token was send. 
  The endpoint is working perfect with ARC so the issue is on the client side.
  does anyone can help me to resolve this issue problem.
  :D</p>