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

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: 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..d918bb09b4e8144cb3a4ddd9c021517c597dcc21 100644
--- a/sdk/lib/io/http_body_impl.dart
+++ b/sdk/lib/io/http_body_impl.dart
@@ -110,6 +110,23 @@ class _HttpBodyHandler {
"json",
JSON.parse(body.body)));
+ case "x-www-form-urlencoded":
+ return asText(Encoding.UTF_8)
Søren Gjesse 2013/05/07 13:39:29 This might as well be ASCII, as all non-alphanumer
Anders Johnsen 2013/05/07 14:04:30 Done.
+ .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,
Søren Gjesse 2013/05/07 13:39:29 Fits one line?
Anders Johnsen 2013/05/07 14:04:30 Done.
+ "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