Media type
A media type (also MIME type and content type) is a two-part identifier for file formats and format contents transmitted on the Internet. The Internet Assigned Numbers Authority (IANA) is the official authority for the standardization and publication of these classifications. Media types were first defined in Request for Comments 2045 in November 1996, at which point they were named MIME (Multipurpose Internet Mail Extensions) types.
Naming
A media type is composed of a type, a subtype, and optional parameters.
As an example, an HTML file might be designated text/html; charset=UTF-8
. In this example text
is the type, html
is the subtype, and charset=UTF-8
is an optional parameter indicating the character encoding.
Media type consists of top-level type name and sub-type name, which is further structured into so-called "trees". Media types can optionally define companion data, known as parameters.
top-level type name / subtype name [ ; parameters ]
top-level type name / [ tree. ] subtype name [ +suffix ] [ ; parameters ]