diff --git a/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart b/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart index 4ebb10f0..6ace5778 100644 --- a/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart +++ b/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart @@ -73,15 +73,15 @@ class DynamiteRawResponse { // ignore: discarded_futures response.then( (final response) async { + _rawHeaders = response.responseHeaders; + final headers = deserializeHeaders(_rawHeaders, serializers, headersType); + _rawBody = switch (bodyType) { const FullType(Uint8List) => await response.bytes, const FullType(String) => await response.string, _ => await response.json, }; - _rawHeaders = response.responseHeaders; - final body = deserializeBody(_rawBody, serializers, bodyType); - final headers = deserializeHeaders(_rawHeaders, serializers, headersType); _response = DynamiteResponse( response.statusCode,