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

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

Issue 195893019: Add fixed content type values for commonly used content types (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | tests/standalone/io/http_headers_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http.dart
diff --git a/sdk/lib/io/http.dart b/sdk/lib/io/http.dart
index acc5db1c1ef67dede351ebad59f5415224c6ac28..dd9de06f476984382d0ebe701a09e0baebaeef6a 100644
--- a/sdk/lib/io/http.dart
+++ b/sdk/lib/io/http.dart
@@ -590,6 +590,34 @@ abstract class HttpSession implements Map {
*/
abstract class ContentType implements HeaderValue {
/**
+ * Content type for plain text using UTF-8 encoding.
+ *
+ * text/plain; charset=utf-8
+ */
+ static final TEXT = new ContentType("text", "plain", charset: "utf-8");
+
+ /**
+ * Content type for HTML using UTF-8 encoding.
+ *
+ * text/html; charset=utf-8
+ */
+ static final HTML = new ContentType("text", "html", charset: "utf-8");
+
+ /**
+ * Content type for JSON using UTF-8 encoding.
+ *
+ * application/json; charset=utf-8
+ */
+ static final JSON = new ContentType("application", "json", charset: "utf-8");
+
+ /**
+ * Content type for binary data.
+ *
+ * application/octet-stream
+ */
+ static final BINARY = new ContentType("application", "octet-stream");
+
+ /**
* Creates a new content type object setting the primary type and
* sub type. The charset and additional parameters can also be set
* using [charset] and [parameters]. If charset is passed and
« no previous file with comments | « no previous file | tests/standalone/io/http_headers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698