The Angular docs say:
The response body doesn\'t return all the data you may need. Sometimes servers return special headers or status codes to indic
Typescript complains about this problem
Type 'string' is not assignable to type "body"
To solve this, convert string to body manually. Example:
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json'
}),
observe: 'response' as 'body'
};
return this.http.post(url, data, httpOptions);