Internet media type
From Helpful
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
Note that source code is in theory
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:
Contents
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:
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)
This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me) |
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/javascriptin practice
- application/javascriptin theory (see note above)
- Also seen:
- application/x-javascript
-
- JSON
- application/json(see also RFC 4627)
- (note: JSONP is Javascript code, not JSON)
- XML:
- text/xmlin practice
- application/xmlin theory (see note above)
- JPEG
- image/jpeg
- You also see:
- image/jpg(common mistake, not everything likes this)
- image/pjpegfor progressive JPEG - not standard (though apparently acceptable?)
-
- PDF:
- application/pdfRFC 3778
- Also sometimes seen:
- application/x-pdf
- text/pdf
- text/x-pdf
-
- MP3