HTTP Content Negotiation — 406 Not Acceptable and Accept Header Errors
Warning4xx client error
Overview
Fix HTTP 406 Not Acceptable errors caused by content negotiation failures when the server cannot produce a response matching the client's Accept headers.
Key Details
- Content negotiation allows clients to request specific formats via Accept, Accept-Language, Accept-Encoding headers
- HTTP 406 Not Acceptable means the server cannot produce a response matching any of the client's acceptable formats
- Server-driven negotiation uses client headers; agent-driven negotiation uses 300 Multiple Choices
- The Accept header specifies media types: application/json, text/html, image/webp, etc.
- Quality values (q=0.9) let clients express preference ordering
Common Causes
- Client requesting a format the server does not support (e.g., Accept: application/xml on a JSON-only API)
- Overly restrictive Accept header excluding the server's available formats
- API versioning via Accept header with an unsupported version string
- Misconfigured reverse proxy stripping or modifying Accept headers
Steps
- 1Check which formats the API supports in its documentation
- 2Set Accept: */* to accept any format, or Accept: application/json, text/html for common web formats
- 3If using API versioning via Accept header, verify the version string matches supported versions
- 4Test the request with curl adding -H 'Accept: application/json' to isolate the issue
- 5Check proxy and CDN configuration to ensure Accept headers are forwarded correctly
Tags
content-negotiation406accept-headermedia-typenot-acceptable
Related Items
More in 4xx Client Error
http-400-bad-requestHTTP 400 Bad Request — What It Means & How to Fix It
Errorhttp-401-unauthorizedHTTP 401 Unauthorized — What It Means & How to Fix It
Errorhttp-402-payment-requiredHTTP 402 Payment Required — What It Means & How to Fix It
Errorhttp-403-forbiddenHTTP 403 Forbidden — What It Means & How to Fix It
Errorhttp-404-not-foundHTTP 404 Not Found — What It Means & How to Fix It
Errorhttp-405-method-not-allowedHTTP 405 Method Not Allowed — What It Means & How to Fix It
ErrorFrequently Asked Questions
It means the client accepts any media type. This is the most permissive Accept value and should never trigger a 406 response.