What 406 means
The server can’t produce a response in any format the request’s Accept headers say they’ll accept (Accept, Accept-Language and so on).
When servers send it
Mostly in APIs that strictly enforce content negotiation, and from some web application firewalls that use 406 for blocked requests.
Common causes
- An
Accept: application/xmlheader sent to a JSON-only API. - An over-strict
Acceptheader set by a client library. - Security modules such as ModSecurity, which some hosts configure to block requests with 406.
How to fix it as a developer
- Send
Accept: application/json(or*/*) to JSON APIs. - Many servers simply ignore
Acceptand send their default format, which RFC 9110 allows. - If a 406 appears on a normal page, check the host’s firewall or ModSecurity logs.
How to fix it as a visitor
- Try a different browser or turn off extensions. If it keeps happening, tell the site owner.
Related codes
- 415 Unsupported Media Type: The server doesn’t accept the format of the request body, usually because of the Content-Type header.
- 400 Bad Request: The server can’t or won’t handle the request because something in it is malformed.
- 403 Forbidden: The server understood who you are and won’t let you do this.
Where it’s defined
406 Not Acceptable is defined in RFC 9110, section 15.5.7. It’s a 4xx code, the client error class: something is wrong with the request, so sending it again unchanged won’t help.
Other 4xx codes
400 Bad Request · 401 Unauthorized · 402 Payment Required · 403 Forbidden · 404 Not Found · 405 Method Not Allowed · 408 Request Timeout · 409 Conflict · 410 Gone · 413 Content Too Large · 414 URI Too Long · 415 Unsupported Media Type · 418 I’m a teapot · 422 Unprocessable Content · 429 Too Many Requests · 431 Request Header Fields Too Large · 451 Unavailable For Legal Reasons · 499 Client Closed Request
Or search them all in the HTTP status code list.
Questions people ask
What does HTTP 406 Not Acceptable mean?
What’s the difference between 406 and 415?
Accept header). 415 is about the request body’s format (your Content-Type header).