Explaining Content-Types
- MIME (Multipurpose Internet Mail Extensions) defines how data is formatted and transmitted over the Internet.
- Each content type has the form:
type/subtype - They’re used in HTTP headers (
Content-Type), email headers, and many other protocols. - The type is the general category (e.g.,
text,image,application), and the subtype specifies the exact format (e.g.,html,png,json).
Example in HTTP:
Content-Type: application/json; charset=utf-8
Common MIME Content-Types
Text
text/plain— plain texttext/html— HTML documentstext/css— Cascading Style Sheetstext/javascript(old) /application/javascript(modern) — JavaScripttext/csv— Comma-separated valuestext/markdown— Markdown text
Images
image/jpeg— JPEG imagesimage/png— PNG imagesimage/gif— GIF imagesimage/webp— WebP imagesimage/svg+xml— SVG (vector graphics, XML-based)image/bmp— Bitmapimage/tiff— TIFF imagesimage/x-icon— ICO (favicons)
Data Interchange (Structured)
application/json— JSON dataapplication/xml— XML data (generic)text/xml— XML data (older, treated as text)application/xhtml+xml— XHTML documents
General Binary Data
application/octet-stream— arbitrary binary data (default if unknown)application/zip— ZIP archiveapplication/gzip— Gzip-compressed dataapplication/x-tar— Tar archiveapplication/pdf— Portable Document Formatapplication/msword— Microsoft Word (legacy.doc)application/vnd.openxmlformats-officedocument.wordprocessingml.document— MS Word.docxapplication/vnd.ms-excel— Excel (legacy.xls)application/vnd.openxmlformats-officedocument.spreadsheetml.sheet— Excel.xlsxapplication/vnd.ms-powerpoint— PowerPoint (legacy.ppt)application/vnd.openxmlformats-officedocument.presentationml.presentation— PowerPoint.pptx
Audio / Video
audio/mpeg— MP3 audioaudio/ogg— Ogg Vorbis audioaudio/wav— WAV audiovideo/mp4— MP4 videovideo/x-msvideo— AVI videovideo/webm— WebM videovideo/quicktime— MOV/QuickTime
Multipart (for email / forms / uploads)
multipart/form-data— file uploads via formsmultipart/mixed— email with multiple attachmentsmultipart/alternative— same content in different formats (e.g., plain text + HTML email)multipart/related— documents with linked resources (e.g., HTML + inline images)