@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