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

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

Issue 14865008: Extend HttpBody handler to support 'multipart/form-data'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix interface. 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_body_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.dart
diff --git a/sdk/lib/io/http_body.dart b/sdk/lib/io/http_body.dart
index 7a8a4942f1b6d13204c83a71c3065e6e9649669a..1ec6d175ed730474b4d5ad4d623331befa78ead3 100644
--- a/sdk/lib/io/http_body.dart
+++ b/sdk/lib/io/http_body.dart
@@ -74,7 +74,7 @@ abstract class HttpBody {
* The content type e.g. application/json, application/octet-stream,
* application/x-www-form-urlencoded, text/plain.
*/
- String get mimeType;
+ ContentType get contentType;
/**
* A high-level type value, that reflects how the body was parsed, e.g.
@@ -143,3 +143,26 @@ abstract class HttpRequestBody extends HttpBody {
*/
HttpResponse get response;
}
+
+
+/**
+ * A [HttpBodyFileUpload] object wraps a file upload, presenting a way for
+ * extracting filename, contentType and the data of the uploaded file.
+ */
+abstract class HttpBodyFileUpload {
+ /**
+ * The filename of the uploaded file.
+ */
+ String filename;
+
+ /**
+ * The [ContentType] of the uploaded file. For 'text/\*' and
+ * 'application/json' the [data] field will a String.
+ */
+ ContentType contentType;
+
+ /**
+ * The content of the file. Either a [String] or a [List<int>].
+ */
+ dynamic content;
+}
« no previous file with comments | « no previous file | sdk/lib/io/http_body_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698