When making an HTTP request like this:
return HttpClient.get("url", { headers: requestHeaders, responseType: 'text'});
What encoding is used when turning the response into a string?
When making an HTTP request like this:
return HttpClient.get("url", { headers: requestHeaders, responseType: 'text'});
What encoding is used when turning the response into a string?
Copyright © 2021 Jogjafile Inc.
Checking the official Angular Repository, for the Http Client we can look under common/http:
While looking into the official repo, you can only find a mention of encodings in one particular case, as seen here:
Checking in the network tab of an Angular application, you can see that it does not specify the encoding type, when sending a request, however, the response headers of the response may include it in the
content-typeproperty if the sending server specified it.Like mentioned in the comments, default is utf-8, as mentioned by jonrsharpe.