406 Not Acceptable

The server cannot supply a representation acceptable under the request's negotiation headers.

All HTTP status codes

What does HTTP 406 mean?

A client may ask for a format, language or other representation that the resource cannot provide. A strict server can answer 406 rather than selecting an alternative. The decisive evidence is the negotiation between that request and endpoint. Do not assume every 406 came from standard content negotiation: some security products use it for custom rejection rules, which their logs should explain.

An investigation example

Illustrative format-negotiation investigation
Response: 406 Not Acceptable
Client requests application/xml.
Endpoint offers JSON only.
Action: align the client's Accept header with the documented API.
Verify: the response format matches what the client can parse.

Common causes

  • Accept requests a media type the endpoint cannot return.
  • Language or other representation preferences exclude every available version.
  • An implementation-specific firewall rule returns 406 with a separate explanation.

Diagnose the response

Compare Accept-related headers with supported formats and inspect the server's negotiation policy.

  • Inspect Accept and related preferences in the failing request. Compare a request with a supported representation or broader media range to isolate negotiation.
  • Check the endpoint documentation and returned alternatives rather than blindly removing all headers. The client still needs a format it can safely interpret.
  • If headers are not the cause, use the response identifier to inspect gateway or firewall logs. Correct the specific blocking rule without disabling unrelated protection.

What it means for website monitoring

Compare request headers when monitoring and browser outcomes differ. If a firewall generated the code, investigate its event record rather than changing the application's response formats.

Reference