We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3ad1276 + cf5ef1e commit 161fbbfCopy full SHA for 161fbbf
1 file changed
lib/src/adapter/remote_adapter.dart
@@ -359,8 +359,8 @@ mixin _RemoteAdapter<T extends DataModelMixin<T>> on _SerializationAdapter<T> {
359
360
try {
361
final request = http.Request(method.toShortString(), uri & params);
362
- request.headers.addAll(headers);
363
+ // First assign the body to don't auto add the charset into 'Content-Type' header
364
if (body != null) {
365
if (body is String) {
366
request.body = body;
@@ -372,6 +372,8 @@ mixin _RemoteAdapter<T extends DataModelMixin<T>> on _SerializationAdapter<T> {
372
throw ArgumentError('Invalid request body "$body".');
373
}
374
375
+
376
+ request.headers.addAll(headers);
377
378
final stream = await httpClient.send(request);
379
response = await http.Response.fromStream(stream);
0 commit comments