I am trying to make a third party authorisation. When I hit a POST request to server, it sends HTML as response.
Header
private httpOptions = {
headers: new HttpHeaders({
'Accept': 'text/html',
'Content-Type': 'application/json'
}),
responseType: 'text',
};
API Call
return this.http.post(this.authUrl, this.httpOptions)
.subscribe(data => {
console.log(data);
});
I am getting a SyntaxError:
Unexpected token < in JSON at position 0 at JSON.parse