406 Not Acceptable

No representation matches your Accept headers.

4xx · Client error

What it means

The server can't produce a response matching the request's Accept, Accept-Language or Accept-Encoding headers.

Most servers ignore this and send their default representation instead, which is usually more useful.

Why you're seeing it

  • A client sending Accept: application/xml to a JSON-only API.
  • Strict content negotiation in a framework.
  • Some security modules use 406 to block requests they don't like.

How to fix it

  • Send an Accept header the server supports, or */*.
  • On the server, consider falling back to a default format instead of failing.

Example response

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

{"error": "supported types: application/json"}