sajad torkamani

In a nutshell

A MIME type (aka media type) is metadata describing an HTTP resource type. User ages (e.g., web browsers) usually specify the mime type of their request by including a Content-Type header (e.g., Content-Type: text/html). Web servers also add a Content-Type header to help web user agents to render or manipulate the response correctly.

In short, here are some uses of a MIME type:

  • User agents (e.g., web browsers) determine what sort of data the server returned so they can render that data in an appropriate format.
  • Servers can restrict the type of data that a user agent can send (e.g., only json).
  • User agents can request a specific type of data (amongst many possibilities) from the server ( e.g., jsonhtmlxml, etc).

Check MIME type of a file on Unix systems

file --mime <some-file>

Example output:

hello.txt: Unicode text, UTF-8 text


Tagged: HTTP