Internet media type
Internet Media Type (previously known as MIME type), and sometimes referred to as Content-Type (from the HTTP header it is often seen in) are the type/subtype specification of the type of content.
It is used in
- HTTP, most typically like Content-Type: text/plain; charset="UTF-8" (note: the charset part is optional but useful)
- each part of a MIME container
- and in various other places
The official list of MIME types is kept by IANA:
x-, vnd-, and such
something/x- are private subtypes
- are not registered
- (cannot be registered as exactly that. The registered form is often the same without the x-)
- in theory everything non-registered should have this. Many but not all follow this.
Similarly, if you think up new type, it should also start with x- (to avoid conflicts with future standard types)
vnd are used when tied to vendor-specific and publicly available products, though that's a bit of a fuzzy distinction.
See also:
On charsets
HTTP and MIME allow the specification of character set on text/ types.
The value should be one registered at:
https://www.iana.org/assignments/character-sets/character-sets.xhtml
Charset names are considered case insensitive
(see e.g. RFC 2616 clause 3.4
...though some browsers/UAs have been known to be case sensitive(verify)
See also:
- RFC 6657
See also
- http://en.wikipedia.org/wiki/Internet_media_type Internet media type
- RFC 2046
- http://www.iana.org/assignments/character-sets
"What's the mime type for..." (some common stuff)
Note that source code is in theory application/ over text/ whenever it settles its own character set (in specs or the document itself), such as in the case of javascript and XML. See also RFC 4329 and this mention
- CSS
- text/css
- Javascript
- often text/javascript in practice
- application/javascript in theory (see note above)
- Also seen:
- application/x-javascript
- JSON
- application/json (see also RFC 4627)
- (note: JSONP is Javascript code instead, not JSON data)
- YAML - didn't have one for a long long time, so don't assume
- XML:
- text/xml in practice
- application/xml in theory (see note above)
- JPEG
- image/jpeg
- You also see:
- image/jpg (common mistake, not everything likes this)
- image/pjpeg for progressive JPEG - not standard (though apparently acceptable?)
- PNG
- image/png
- GIF
- image/gif
- PDF:
- application/pdf RFC 3778
- Also sometimes seen:
- application/x-pdf
- text/pdf
- text/x-pdf
- MP3
- audio/mpeg according to RFC 3003 and HTML5[1]
- A web search also shows a dozen others
- 'arbitrary binary data' (quoth e.g. RFC 2046)
- application/octet-stream