title: Angular 2+ 4+ connecting an outside api with angular headers
body: <p>I needs some help connecting an outside ServiceNow API with an Angular Request header. Not sure if I am doing this the proper way or not. Thanks for any help. </p>
  
  <pre><code>url = 'https://dev21120.service-now.com/api/now/table/incident?sysparm_query=active%3Dtrue%5Eshort_descriptionLIKEemail&amp;sysparm_display_value=true&amp;sysparm_fields=number%2Cshort_description&amp;sysparm_limit=10'
  
  Headers
  Accept application/json
  Content-Type application/json
  X-UserToken44ca4971db0313002bf5d001cf9619f880b26a74bf9250a48d9e765a49757f28d8b26cd7
  </code></pre>
  
  <p>I keep getting authorization error and I am thinking its the way I am passing in my headers </p>
  
  <pre><code>constructor(private http: Http) {
      this.headers = new Headers();
      this.headers.append('Authorization', 'Basic' + btoa(this.username + ':' + this.password)); 
      this.headers.append('Content-Type', 'application/json');
      this.headers.append('Accept', 'application/json');
  }
  
  getStuff() {
    this.http.get(this.url)
    return this.http.get(this.url)
    .map(response =&gt; response.json());
  }
  </code></pre>