Skip to content

Commit 48e4c8a

Browse files
committed
Use updateMap to add content type
1 parent 2e89a0a commit 48e4c8a

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

lib/src/request.dart

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,15 @@ class Request extends Message {
143143

144144
var boundary = _boundaryString();
145145

146-
headers ??= <String, String>{};
147-
headers['content-type'] = 'multipart/form-data; boundary=$boundary';
148-
149146
return new Request._(
150-
'POST',
151-
url,
152-
new MultipartBody(fields, files, boundary),
153-
null,
154-
headers,
155-
context,
156-
);
147+
'POST',
148+
url,
149+
new MultipartBody(fields, files, boundary),
150+
null,
151+
updateMap(headers, <String, String>{
152+
'content-type': 'multipart/form-data; boundary=$boundary'
153+
}),
154+
context);
157155
}
158156

159157
Request._(this.method, this.url,

0 commit comments

Comments
 (0)