@supriya16 wrote:
Hi ,
I am having post auth Problem. I am passing Auth Key to post method still getting no authorisation.
Here is the sample code .getUserDetails(val) {
var headers = new Headers();
headers.append(‘Accept’, ‘application/json’);
headers.append(‘Content-Type’, ‘application/json’);
headers.append(‘Authorization’, 'Bearer ’ + val);this.httpP.post('https://mydomain.com/api/details', { headers: headers }) .subscribe(data => { // if (data.ok == true) { // } console.log(data) }, error => { console.log(error) } );
}
I have used CORS policy.
It’s POST method.Postman its giving value but UI it’s failing.
Posts: 1
Participants: 1