HTTP 406 Not Acceptable

The server cannot produce a response matching the list of acceptable values in the request.

4xx Client Error

406

Not Acceptable

Description

The 406 Not Acceptable status code indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. The server should generate a payload containing a list of available representation characteristics and corresponding resource identifiers from which the user agent or user can choose the most appropriate. Content negotiation headers that may trigger this response include Accept, Accept-Language, Accept-Encoding, and Accept-Charset.

When Is It Used?

Returned when the server cannot produce content in a format acceptable to the client. For example, if the client requests XML (Accept: application/xml) but the server can only produce JSON, or requests a language the server does not support.

Example Response

HTTP/1.1 406 Not Acceptable
Content-Type: application/json

{"error": "not_acceptable", "supported_types": ["application/json", "text/html"]}

Look Up Any Status Code

Browse all status codes