diff --git a/lib/src/http/utils.dart b/lib/src/http/utils.dart index 0151daf0..8b1abb2a 100644 --- a/lib/src/http/utils.dart +++ b/lib/src/http/utils.dart @@ -195,6 +195,7 @@ MediaType parseContentTypeFromHeaders(Map headers) { Encoding? parseEncodingFromContentType(MediaType? contentType, {Encoding? fallback}) { if (contentType == null) return fallback; + if (contentType.type == 'application' && contentType.subtype == 'json') return utf8; if (contentType.parameters['charset'] == null) return fallback; final encoding = Encoding.getByName(contentType.parameters['charset']); return encoding ?? fallback;