406 Not Acceptable

HTTP 406 status code means a server can’t return the requested version of the resource.

Clients can ask servers to serve a particular version of the resource (e.g. HTML document, image file, JSON object).

For example, imagine a user has a Spanish locale set as a default (es-ES). A browser can (and will) ask a server to provide a Spanish version of the website, if possible, but otherwise fall back to an English version.

Accept-Language: es-ES, es;q=1, en;q=0.5

This process is called content negotiation. Apart from a language, clients can negotiate:

HTTP spec states that browsers can respond with 406 Not Acceptable when the server is unwilling to supply a default representation. However, in reality, most servers do fall back to the default representation.

Interested in no-nonsense technical guides?

No spyware, no promotional emails, or keyword-stuffed junk. I will only send you a single email when I've got something interesting to say. Unsubscribe anytime.

You can also subscribe to the Atom feed (it's like RSS, but better).