Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70750

Post Authentication error

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 70750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>