The server cannot produce a response matching the client's Accept headers.
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.
Accept: */* or omit the header to accept anythingAccept: application/json for most modern APIscurl -i -H "Accept: application/xml" https://api.example.com/users
HTTP/2 406
content-type: application/json
{"error":"only application/json supported"}
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.