Client Error · 4xx

406 Not Acceptable

The server cannot produce a response matching the client's Accept headers.

What 406 Not Acceptable means

406 Not Acceptable is content negotiation rejection. The client said Accept: application/xml but the server only produces JSON, so the server returns 406 rather than send the wrong format. In practice, 406 is rare; most servers default to JSON regardless of Accept headers, or return whatever they have. The response body should ideally include a list of acceptable representations the client could ask for instead.

When servers should return it: Return 406 only when you genuinely cannot produce any of the requested content types and you do not want to fall back to a default.

Common causes

How to fix 406 Not Acceptable

Example response

curl -i -H "Accept: application/xml" https://api.example.com/users

HTTP/2 406
content-type: application/json
{"error":"only application/json supported"}

Related status codes

Frequently Asked Questions

How is 406 different from 415?
406 is about the response Content-Type the client will accept. 415 is about the request Content-Type the server can parse.
Defined in: RFC 9110 · Class: 4xx Client Error

More references

For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.