dart:io
ContentType class
Representation of a content type. An instance of ContentType is immutable.
- Implements
-
Constructors
- ContentType(String primaryType, String subType, { String charset, Map<String, String> parameters })
factory
- 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 parameters
contains charset as well the passed charset
will override the value in parameters. Keys passed in parameters will be converted to lower case. The charset
entry, whether passed as charset
or in parameters
, will have its value converted to lower-case.
Properties
- charset → String
read-only
- Gets the character set.
- mimeType → String
read-only
- Gets the mime-type, without any parameters.
- primaryType → String
read-only
- Gets the primary type.
- subType → String
read-only
- Gets the sub type.
- hashCode → int
read-only, inherited
- The hash code for this object. [...]
- parameters → Map<String, String>
read-only, inherited
- Gets the map of parameters. [...]
- runtimeType → Type
read-only, inherited
- A representation of the runtime type of the object.
- value → String
read-only, inherited
- Gets the header value.
Methods
- noSuchMethod(Invocation invocation) → dynamic
inherited
- Invoked when a non-existent method or property is accessed. [...]
- toString() → String
inherited
- Returns a string representation of this object.
Operators
- operator ==(dynamic other) → bool
inherited
- The equality operator. [...]
Static Properties
- BINARY → ContentType
- binary → ContentType
final
- Content type for binary data. [...]
- HTML → ContentType
- html → ContentType
final
- Content type for HTML using UTF-8 encoding. [...]
- JSON → ContentType
- json → ContentType
final
- Content type for JSON using UTF-8 encoding. [...]
- TEXT → ContentType
- text → ContentType
final
- Content type for plain text using UTF-8 encoding. [...]
Static Methods
- parse(String value) → ContentType
- Creates a new content type object from parsing a Content-Type header value. As primary type, sub type and parameter names and values are not case sensitive all these values will be converted to lower case. Parsing this string [...]