Committed by
GitHub
Merge pull request #1452 from calvingit/bug-fixed
Add content type and length into the headers when the content type is 'application/x-www-form-urlencoded'
Showing
1 changed file
with
2 additions
and
0 deletions
@@ -115,6 +115,8 @@ class GetHttpClient { | @@ -115,6 +115,8 @@ class GetHttpClient { | ||
115 | }); | 115 | }); |
116 | var formData = parts.join('&'); | 116 | var formData = parts.join('&'); |
117 | bodyBytes = utf8.encode(formData); | 117 | bodyBytes = utf8.encode(formData); |
118 | + headers['content-length'] = bodyBytes.length.toString(); | ||
119 | + headers['content-type'] = contentType; | ||
118 | } else if (body is Map || body is List) { | 120 | } else if (body is Map || body is List) { |
119 | var jsonString = json.encode(body); | 121 | var jsonString = json.encode(body); |
120 | 122 |
-
Please register or login to post a comment