Some times we want to get simple string as a return type from web api. How to handle string as return type in angular 8
is given below.
GetData(Id:number):
Observable<string> {
var headers = new HttpHeaders().set('Content-Type', 'text/plain; charset=utf-8');
return this.httpClient.get<any>(this.linkurl+getCarList? Id ='+ Id, { headers, responseType: 'text' as 'json' });
} |