dio
dio copied to clipboard
Mismatching `Content-Type` header value with Dio options' `ResponseType`.
It seems there is a bug in transformResponse method of class DefaultTransformer (or somewhere deeper).
I use external API which returns token as JSON String, i.e. the result is:
""ZXlKaGJHY2lPa...""
And because dio consider this response as ResponseType.plain instead of ResponseType.json (but it is a JSON) it does not decode those JSON String to regular String.

As you may notice on image the Content-Type of HTTP response is application/json but internal options.responseType is not ResponseType.json which is requried for calling json.decode method.
Dio version 4.0.6 Flutter version: 3.0.5
And please stop forcing the lower case on headers!