ContentType class

Representation of a content type. An instance of ContentType is immutable.

Representation of a content type. An instance of ContentType is immutable.

Implements:

Constructors

ContentType ( String primaryType, String subType, {String charset, Map<String,String> parameters} )
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 c...

Static Properties

TEXT dynamic
read-only
Content type for plain text using UTF-8 encoding.
HTML dynamic
read-only
Content type for HTML using UTF-8 encoding.
JSON dynamic
read-only
Content type for JSON using UTF-8 encoding.
BINARY dynamic
read-only
Content type for binary data.

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 ...

Instance Properties

mimeType String
read-only
primaryType String
read-only
subType String
read-only
charset String
read-only
value String Inherited
read-only
parameters Map<String,String> Inherited
read-only