MIME Types (Internet Media Types)
A MIME type (now called an Internet media type) labels the format of a resource: type/subtype, optionally with parameters like charset=utf-8 or structured syntax suffixes such as +json.
Common top-level types
| Type | Role | Examples |
|---|---|---|
text | Human-readable text | text/plain, text/html, text/css |
application | Binary or structured data | application/json, application/pdf, application/octet-stream |
image | Raster/vector images | image/png, image/jpeg, image/svg+xml |
audio / video | Media containers | audio/mpeg, video/mp4 |
font | Web fonts | font/woff2 |
multipart | Composite bodies | multipart/form-data, multipart/byteranges |
Sniffing vs declared type
Browsers may sniff content when Content-Type is missing or generic. For uploads, validate both extension and magic bytes server-side — MIME from the client is untrusted.