Getting 401 status even passing application id and key for each request
let headers = new Headers({ 'Content-Type': 'application/x-www-form-urlencoded',});
let options = new RequestOptions({ headers: headers });
options.headers.set('Accept', "application/json,text/xml ");
options.headers.set('X-AYLIEN-NewsAPI-Application-ID', "ff6**d33");
options.headers.set('X-AYLIEN-NewsAPI-Application-Key', "b7445d942********7c06e");
API Call:
this.http.get(url)
.subscribe(res => {
resolve(res.json());
}, (err) => {
reject(err);
});
});
}
This is the code i am using to set value in header but it is not working.