unable to execute post request with authorization header
问题 I have an issue in angular 4 when I post a request API with Authorization header? addPost(body): Observable<any>{ const url = 'https://xxxxxx'; return this.http.post(URL, body, this.options) .map((res:Response) => { this.data = res.json(); }) } token comes from firebase auth afAuth.auth.currentUser.getIdToken() .then(token => { this.headers = new Headers({ 'Authorization': 'Bearer '+token }); this.headers.append('Content-Type', 'application/json'); this.options = new RequestOptions({ headers: