Tested CORS and its working fine. I'm getting response also from server. API service call below
login (user: any) {
return this.http.post(this.url, user, httpOptions);
}
Angular component method that listens this api is below
this.auth.login(this.user).subscribe(
data=>{
alert(JSON.stringify(data));
},
error=>{
alert(JSON.stringify(error));
}
);
Please take a look at above image. CORS is working fine. But The subscribe is always falling into error. And the error message is below
{"headers":{"normalizedNames":{},"lazyUpdate":null,"headers":{}},"status":0,"statusText":"Unknown Error","url":null,"ok":false,"name":"HttpErrorResponse","message":"Http failure response for (unknown url): 0 Unknown Error","error":{"isTrusted":true}}
