I am always getting an error
ERROR Error: Uncaught (in promise): e: {"headers":{"normalize dNames":{},"lazyUpdate":null},"status":400,"statusText":"Bad Request"
code is: (updated)
async verify() {
let schema = {"token": localStorage.getItem('id_token')};
let response: any = await this.http.post('/api-token-verify/', schema).toPromise();
return response;
}
public async tokenAliveState() {
console.log("1");
let stuff = await this.verify();
console.log("2");
console.log("Returning from tokenAliveState");
return tokenNotExpired('id_token');
}
All I want to do is make a post and wait for the response before moving on. The response is plain JSON.
Angular core 4.
Any ideas? Any more info needed?
Does anyone have a working example of a simple function to wait on an http response before continuing execution? All the example I found online show similar to this but no matter what I do I get the uncaught exception.
400means./api-token-verify/correct? doesschemacontain the proper data? Just saying... some questions to point you in the right direction...