4. Discrete Media Type Values
The five discrete top-level media types are: text, image, audio, video, and application.
4.1. Text Media Type
The text media type is used for information represented in textual form.
4.1.1. Representation of Line Breaks
The content of text types is assumed to be line-oriented. Line breaks must be represented using the CRLF sequence.
4.1.2. Charset Parameter
The most important parameter for text types is the charset parameter. It specifies the character set used to represent the text.
Common Character Sets:
US-ASCII: 7-bit ASCII (default)UTF-8: Unicode UTF-8 encoding (recommended)ISO-8859-1: Western European languagesGB2312,GBK,GB18030: Simplified ChineseBig5: Traditional ChineseShift_JIS,EUC-JP: Japanese
4.1.3. Plain Subtype
text/plain is the most basic text subtype, representing plain text.
Content-Type: text/plain; charset=UTF-8
4.1.4. Other Text Subtypes
text/html: HTML documentstext/css: CSS stylesheetstext/javascript: JavaScript codetext/csv: Comma-separated valuestext/xml: XML documents
4.2. Image Media Type
The image media type is used to convey static (non-animated) graphic image data.
Common Subtypes:
image/jpeg: JPEG imagesimage/png: PNG imagesimage/gif: GIF images (can include animation)image/svg+xml: SVG vector graphicsimage/webp: WebP images
Content-Type: image/jpeg
4.3. Audio Media Type
The audio media type is used to transmit audio or voice data.
Common Subtypes:
audio/mpeg: MP3 audioaudio/mp4: MP4 audioaudio/wav: WAV audioaudio/ogg: Ogg Vorbisaudio/webm: WebM audio
Content-Type: audio/mpeg
4.4. Video Media Type
The video media type is used to transmit video or moving image data, possibly with audio.
Common Subtypes:
video/mp4: MP4 videovideo/mpeg: MPEG videovideo/ogg: Ogg Theoravideo/webm: WebM video
Content-Type: video/mp4
4.5. Application Media Type
The application media type is used for discrete data that does not fit into other types.
4.5.1. Octet-Stream Subtype
application/octet-stream is used for binary data with unspecified or unknown subtype.
Content-Type: application/octet-stream
4.5.2. PostScript Subtype
application/postscript is used for PostScript programs.
4.5.3. Other Application Subtypes
application/pdf: PDF documentsapplication/json: JSON dataapplication/xml: XML dataapplication/zip: ZIP compressed filesapplication/javascript: JavaScriptapplication/x-www-form-urlencoded: Form data
Summary:
| Type | Purpose | Common Subtypes |
|---|---|---|
| text | Textual data | plain, html, css |
| image | Images | jpeg, png, gif |
| audio | Audio | mpeg, wav, ogg |
| video | Video | mp4, mpeg, webm |
| application | Other | pdf, json, zip, octet-stream |