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

Error: "Uncaught (in promise): [object Object]

$
0
0

@gokulanathan wrote:

Error occurs when i try to post in get method to rest api. but in postman it working perfectly.

 public cartview() {
let localaccesstoken = localStorage.getItem('token');
let apiUrl = this.urlService.apiUrl+'cart?access_token='+localaccesstoken;
console.log(apiUrl);
return new Promise((resolve, reject) => {
  console.log("test : "+apiUrl);
    this.http.get(apiUrl)
      .subscribe(res => {
        console.log("w3cert Url : "+JSON.stringify(res));

         console.log(resolve(res));
      }, (err) => {
        console.log('w3cert : '+reject(err));
    });
});

In console log shows an api. I copied that api and posted in postman it working. but in app it shows error

Error: “Uncaught (in promise): [object Object]”

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70440

Trending Articles



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