encoding property

Encoding? encoding

Encoding that will be used to decode the response body. This encoding is selected based on contentType's charset parameter. If charset is not given or the encoding name is unrecognized, latin1 is used by default (RFC 2616).

Implementation

// TODO: That default has been superceded ([RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#appendix-B))
// and there is no longer a default, it should use the charset of the media type.
// But we don't have the media type's encoding, so leaving this for the moment. The most
// important media type for this is JSON, which we hard-code to utf-8.
Encoding? get encoding => _encoding;