I am using HttpClient to request the server I have no control of.
It is returning 200 HTTP status code if success and 400 is operation fail.
this.http
.post(this.getUrl(), data, { headers: headers, responseType: 'text' })
.pipe(catchError(this.handleError))
.subscribe();
handleError(error) {
error.status; // always CORS error (0) however real HTTP code is 200 or 400
...
}
For example that is the success code
So my question is there any way to get the real HTTP code instead of CORS error code using HttpClient if it is not possible is there at least a way to hide CORS warning messages in browser console?