MockFoxAdvertise

HTTP 406 Not Acceptable

Updated Free mock REST & WebSocket APIs

HTTP 406 Not Acceptable — The server can't produce a response matching the client's Accept headers.

Class
4xx Client Error
Defined in
RFC 9110 §15.5.7
Official
Yes (IANA registry)
Cacheable by default
No (unless Cache-Control/Expires say so)
Safe to retry
Not without changing the request

Try it: get a real 406 response

Our test endpoint answers every request with 406 Not Acceptable.

curl -i https://mockfox.dev/api/status/406

Use it in tests, health-check monitors or to see how your client handles a 406. Add ?delay=2000 to slow it down.

What does HTTP 406 mean?

Proactive content negotiation failed: the client sent Accept: application/xml (or Accept-Language, Accept-Encoding) and the server only has JSON. Most servers ignore Accept and return their default format instead, which the spec also allows. Some web application firewalls (notably ModSecurity) return 406 when they block a request, which is confusing because it has nothing to do with Accept.

How to fix 406

  1. Visitors: Reload the page, check the address for typos, and clear the site's cookies. If it persists, the site owner needs to fix it.
  2. Developers: Read the response body and server logs for details, fix the request (method, headers, body, credentials) and return a clear error message to clients.

Example 406 response

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

{"status":406,"error":"Not Acceptable"}

4xx Client Error: The request contains an error or can't be fulfilled — fix the request before retrying. See the full list of HTTP status codes.

Related status codes

Related tools

Frequently asked questions

What does HTTP 406 Not Acceptable mean?

The server can't produce a response matching the client's Accept headers.

Is 406 a client or a server error?

406 is a 4xx code, so it signals a problem with the request (as seen by the server). Retrying the identical request usually gives the same result.

Where is 406 defined?

In RFC 9110 §15.5.7. It's listed in the IANA HTTP Status Code Registry.

How can I test how my app handles a 406?

Call https://mockfox.dev/api/status/406 — it responds with 406 to any method, with CORS enabled. Add ?delay=2000 to simulate a slow response.