Media type

From Wiki @ Karl Jones dot com
Jump to: navigation, search

A media type (also MIME type and content type) is a two-part identifier for file formats and format contents transmitted on the Internet.

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 ]

The currently registered top-level type names are:

  • application
  • audio
  • example
  • image
  • message
  • model
  • multipart
  • text
  • video

Sub-type name typically consists of a media type name, but it may or must also contain other content, such as tree prefix (facet), producer's name, product name or suffix - according to the different rules in registration trees.

Common examples

  • application/json
  • application/x-www-form-urlencoded
  • multipart/form-data
  • text/html

History

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,[2] at which point they were named MIME (Multipurpose Internet Mail Extensions) types.

Not to be confused with

Not to be confused with MIME.

See also

External links