Skip to main content

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 languages
  • GB2312, GBK, GB18030: Simplified Chinese
  • Big5: Traditional Chinese
  • Shift_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 documents
  • text/css: CSS stylesheets
  • text/javascript: JavaScript code
  • text/csv: Comma-separated values
  • text/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 images
  • image/png: PNG images
  • image/gif: GIF images (can include animation)
  • image/svg+xml: SVG vector graphics
  • image/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 audio
  • audio/mp4: MP4 audio
  • audio/wav: WAV audio
  • audio/ogg: Ogg Vorbis
  • audio/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 video
  • video/mpeg: MPEG video
  • video/ogg: Ogg Theora
  • video/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 documents
  • application/json: JSON data
  • application/xml: XML data
  • application/zip: ZIP compressed files
  • application/javascript: JavaScript
  • application/x-www-form-urlencoded: Form data

Summary:

TypePurposeCommon Subtypes
textTextual dataplain, html, css
imageImagesjpeg, png, gif
audioAudiompeg, wav, ogg
videoVideomp4, mpeg, webm
applicationOtherpdf, json, zip, octet-stream