HTTP 406 Not Acceptable
HTTP 406 Not Acceptable means the target lacks a representation that fits the client’s proactive negotiation preferences and the server chooses to return an error. These preferences can cover media type, language or encoding.
A format the endpoint cannot provide
A JSON-only API could send 406 when the client asks exclusively for XML with Accept: application/xml. Use a documented response type or allow a broader type if your client can handle it. The error body may list the available alternatives.
Compare requests that get different results
Keep the target URL fixed and compare Accept, Accept-Language and Accept-Encoding between clients. If only the proxied path fails, check for header rewrites and verify that any intermediary cache respects the response’s Vary header. For a rejected request body format, see 415.
Use a preference the service can satisfy
A client could send Accept-Language: fr-CA to an endpoint that offers English and French for France. If the user can read either, the client might send Accept-Language: fr-CA, fr;q=0.9, en;q=0.7 to provide acceptable alternatives in order. Compare the selected response’s language and media type with what the client actually supports. Similarly, a client that can parse both JSON and plain text can include both types with different weights if the API documents them.
Investigate inconsistent results through a cache
Use a read-only resource that varies by a single preference. Send the same request with two documented Accept values and compare the response headers, then confirm the negotiated header value at the origin. If one representation appears under both requests, examine whether the shared cache varied its stored entries as the server intended. An origin that correctly sends different versions can still be paired with a misconfigured gateway. Have the site operator use cache and origin logs to identify which layer served the error code.