I'm in need of customizing the authentication header for all API requests. I plan to include this header in the constructor and simply use this.http
in my class methods.
import { Injectable } from '@angular/core';
import { Config, Events } from 'ionic-angular';
import { Http } from '@angular/http';
@Injectable()
export class APIRequest {
constructor (
private http: Http,
private config: Config,
) {
this.http.headers.append('My-Custom-Header','MyCustomHeaderValue');
}
}