Skip to main content
HTTP/4xx (Client Error)

406 Not Acceptable

The server cannot produce a response matching the Accept headers sent by the client.

❓ Why does this happen?

Client sends Accept: application/xml but the API only produces application/json (or a strict WAF rule triggers).

✅ How to fix it

Send Accept: application/json or */* and confirm the content types the endpoint supports.

Return or handle 406 in your stack

// app/api/resource/route.ts
export function GET() {
  return Response.json(
    { error: "Not Acceptable", status: 406 },
    {
      status: 406
    }
  );
}

Live 406 mock endpoint

Point your app, tests, or retry logic at this free public URL to reproduce a real 406 response (CORS enabled, optional ?delay=ms up to 5000).

https://castov.com/api/mock/406

Frequently Asked Questions

What does HTTP Status 406 mean?
The server cannot produce a response matching the Accept headers sent by the client.
Why am I getting a 406 status code?
Client sends Accept: application/xml but the API only produces application/json (or a strict WAF rule triggers).
How do I fix a 406 Not Acceptable error?
Send Accept: application/json or */* and confirm the content types the endpoint supports.
How can I test how my app handles a 406 response?
Send a request to https://castov.com/api/mock/406 — it returns a real 406 Not Acceptable response with CORS enabled. Add ?delay=2000 to simulate a slow server.

Other 4xx status codes

Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.