streamHttpRequest: replaced string buffering with chunk_expansion

This commit is contained in:
Manas Hejmadi
2025-07-04 02:31:42 +05:30
parent 2ab6de6a62
commit 6bcc855d06
3 changed files with 36 additions and 103 deletions

View File

@@ -68,11 +68,9 @@ class HttpResponseModel with _$HttpResponseModel {
}, response.headers);
MediaType? mediaType = getMediaTypeFromHeaders(responseHeaders);
//TODO: Review Effectiveness
final body = decodeBytes(
response.bodyBytes,
response.headers['content-type']!,
);
final body = (mediaType?.subtype == kSubTypeJson)
? utf8.decode(response.bodyBytes)
: response.body;
return HttpResponseModel(
statusCode: response.statusCode,