I'm using post request with HttpClient
like below,
return this.httpclient.post<any>(url, body)
.catch(this.handleError)
then it gives me below error,
Content type 'text/plain;charset=UTF-8' not supported
Then I tried to add headers like below,
const headers = new HttpHeaders({'Content-Type':'application/json; charset=utf-8'});
return this.httpclient.post<any>(url, body, {headers: headers})
.catch(this.handleError)
then it gives me below error,
Response for preflight has invalid HTTP status code 403
- this works fine with
get
request.
what is the reason for this. hope your help with this
Best Answer
Try somethink like this :
It works for me