File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -359,8 +359,8 @@ mixin _RemoteAdapter<T extends DataModelMixin<T>> on _SerializationAdapter<T> {
359359
360360 try {
361361 final request = http.Request (method.toShortString (), uri & params);
362- request.headers.addAll (headers);
363362
363+ // First assign the body to don't auto add the charset into 'Content-Type' header
364364 if (body != null ) {
365365 if (body is String ) {
366366 request.body = body;
@@ -372,6 +372,8 @@ mixin _RemoteAdapter<T extends DataModelMixin<T>> on _SerializationAdapter<T> {
372372 throw ArgumentError ('Invalid request body "$body ".' );
373373 }
374374 }
375+
376+ request.headers.addAll (headers);
375377
376378 final stream = await httpClient.send (request);
377379 response = await http.Response .fromStream (stream);
You can’t perform that action at this time.
0 commit comments