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/406Frequently Asked Questions
What does HTTP Status 406 mean?
Why am I getting a 406 status code?
How do I fix a 406 Not Acceptable error?
How can I test how my app handles a 406 response?
Other 4xx status codes
Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.