title: Add Header to the API Http request, Angular 2, Ionic 2
body: <p>I have an ionic 2 app (which uses Angular 2 Http), i have the code which gets the JSON from the API, however i need to send the app-id, app-key and Accept as a header, this is the main code... </p>
  
  <pre><code>import {Component} from '@angular/core';
  import {NavController} from 'ionic-angular';
  import {Http} from 'angular2/http';
  
  @Component({
  templateUrl: 'build/pages/latest-page/latest-page.html'
   })
   export class LatestPage {
   static get parameters() {
   return [[NavController]];
  }
  
  constructor(_navController, http) {
  
  this._navControler = _navController;
  this.http = http;
  
  this.http.get("https://twit.tv/api/v1.0/people/77").subscribe(data =&gt; {
   console.log("Got Data");
   this.items = JSON.parse(data._body).people;
  }, error =&gt; {
   console.log("Error with Data");
  });
  
   }
  </code></pre>
  
  <p>And this is how i tried to add the header, however its not working...</p>
  
  <pre><code>constructor(_navController, http) {
  
  this._navControler = _navController;
  this.http = http;
  
  var headers = new Headers();
  headers.append('app-id', '0000');
  headers.append('app-key', 'abc000abc');
  headers.append('Accept', 'application/json ');
  
  this.http.get("https://twit.tv/api/v1.0/people/77"),{"Headers": headers}.subscribe (data =&gt; {
  console.log("Got Data");
  this.items = JSON.parse(data._body).people;
  }, error =&gt; {
   console.log("Error with Data");
  });
  
   }
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Thanks</p>