MediaType class

A class representing an HTTP media type, as used in Accept and Content-Type headers.

This is immutable; new instances can be created based on an old instance by calling change.

Constructors

MediaType(String type, String subtype, [ Map<String, String> parameters ])
MediaType.parse(String mediaType)
Parses a media type. [...]
factory

Properties

mimeType → String
The media type's MIME type.
read-only
parameters → Map<String, String>
The parameters to the media type. [...]
final
subtype → String
The secondary identifier of the MIME type. [...]
final
type → String
The primary identifier of the MIME type. [...]
final
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

change({String type, String subtype, String mimeType, Map<String, String> parameters, bool clearParameters: false }) MediaType
Returns a copy of this MediaType with some fields altered. [...]
toString() → String
Converts the media type to a string. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited