ContentType abstract class
Representation of a content type.
abstract class ContentType implements HeaderValue { /** * Creates a new content type object setting the primary type and * sub type. */ factory ContentType([String primaryType = "", String subType = ""]) { return new _ContentType(primaryType, subType); } /** * 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 * * text/html; charset=utf-8 * * will create a content type object with primary type [:text:], sub * type [:html:] and parameter [:charset:] with value [:utf-8:]. */ factory ContentType.fromString(String value) { return new _ContentType.fromString(value); } /** * Gets and sets the content type in the form "primaryType/subType". */ String value; /** * Gets and sets the primary type. */ String primaryType; /** * Gets and sets the sub type. */ String subType; /** * Gets and sets the character set. */ String charset; }
Implements
Constructors
factory ContentType([String primaryType = "", String subType = ""]) #
Creates a new content type object setting the primary type and sub type.
factory ContentType([String primaryType = "", String subType = ""]) { return new _ContentType(primaryType, subType); }
factory ContentType.fromString(String value) #
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
text/html; charset=utf-8
will create a content type object with primary type text
, sub
type html
and parameter charset
with value utf-8
.
factory ContentType.fromString(String value) { return new _ContentType.fromString(value); }
Properties
final Map<String, String> parameters #
Gets the map of parameters.
Map<String, String> get parameters;
Methods
String toString() #
Returns the formatted string representation in the form:
value; parameter1=value1; parameter2=value2
String toString();