Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1074)

Unified Diff: sdk/lib/io/http_body_impl.dart

Issue 14660009: Implement support for application/x-www-form-urlencoded' form data in HttpBodyHandler. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cleanup Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/io/http_multipart_form_data_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_body_impl.dart
diff --git a/sdk/lib/io/http_body_impl.dart b/sdk/lib/io/http_body_impl.dart
index 4410a0e29b284701255b97d194b3d1f96b95ce40..736e86e7e785246012a47b7e2a2e0083b777a416 100644
--- a/sdk/lib/io/http_body_impl.dart
+++ b/sdk/lib/io/http_body_impl.dart
@@ -110,6 +110,21 @@ class _HttpBodyHandler {
"json",
JSON.parse(body.body)));
+ case "x-www-form-urlencoded":
+ return asText(Encoding.ASCII)
+ .then((body) {
+ var map = _HttpUtils.splitQueryString(body.body);
+ var result = {};
+ String parse(String s) {
+ return _HttpUtils.decodeHttpEntityString(
+ _HttpUtils.decodeUrlEncodedString(s));
+ }
+ for (var key in map.keys) {
+ result[parse(key)] = parse(map[key]);
+ }
+ return new _HttpBody(contentType, "form", result);
+ });
+
default:
break;
}
« no previous file with comments | « no previous file | sdk/lib/io/http_multipart_form_data_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698