HTTPfy

406 Not Acceptable

The server cannot produce a response matching the request's Accept headers.

406 at a glance

Code
406
Name
Not Acceptable
Class
4xx Client error
Status
IANA-registered standard code
Defined in
RFC 9110, Section 15.5.7
Cacheable by default
No by default. Caches store it only when the response carries explicit freshness (Cache-Control max-age, s-maxage or Expires).

What 406 means

406 Not Acceptable is the result of proactive content negotiation failing: the client asked, via Accept, Accept-Language or Accept-Encoding, for representations the server cannot provide. RFC 9110 lets servers ignore those headers and send a default instead, which is usually friendlier, so 406 is uncommon.

What typically causes a 406

  • APIs that only return JSON receiving Accept: application/xml.
  • Strict frameworks (Spring, Rails) when the Accept header matches no renderer.
  • Some shared hosts configure ModSecurity to answer blocked requests with 406.

Fix it on the server

  • Fall back to a default representation rather than failing, unless the client truly cannot use it.
  • List available representations in the body.

Fix it as a client or visitor

  • Remove or broaden the Accept header (Accept: */*) and see if the request succeeds.

Headers that go with 406

HeaderRole
AcceptRequest header the server could not satisfy.
VaryLists headers that influence negotiation.

Example response

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

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

Opens the HTTP headers tool with your URL filled in; it shows the status line and headers of every redirect hop.