diff --git a/packages/dynamite/dynamite/lib/src/models/type_result/type_result.dart b/packages/dynamite/dynamite/lib/src/models/type_result/type_result.dart index db2c66ef..46eb94ac 100644 --- a/packages/dynamite/dynamite/lib/src/models/type_result/type_result.dart +++ b/packages/dynamite/dynamite/lib/src/models/type_result/type_result.dart @@ -87,6 +87,11 @@ sealed class TypeResult { return 'json.encode($serialized)'; case 'application/x-www-form-urlencoded': return 'Uri(queryParameters: $serialized! as Map).query'; + case 'application/octet-stream': + if (className != 'Uint8List') { + throw Exception('octet-stream can only be applied to binary data. Expected Uint8List but got $className'); + } + return '$object as Uint8List'; default: throw Exception('Can not encode mime type "$mimeType"'); }