This question already has an answer here:
- Why httpclient in angular 4 is assuming that request am sending json data 1 answer
The server responses with plain text and angular try to parse json. How do i turn of this behaviour in one component?
get(mrn: string): Observable<string> {
let url: string;
url = this.Url;
url = url + '?mrn=' + mrn;
return this.http.get<string>(url);
}
download(testobject: Testobject): void {
this.httpService.get(testobject.mrn)
.subscribe(ccresult => {
console.log('ccresult ist: ' + ccresult);
});
}
Error: error: SyntaxError: Unexpected token N in JSON at position 0 at JSON.parse () at XMLHttp.......