What does HTTP status code 406 mean?
The 406 Not Acceptable status code indicates that the server cannot generate a response format that matches the content negotiation criteria specified in the request’s Accept headers.
When to use it in APIs
Use when a client requests data in XML (Accept: application/xml) but your API only supports JSON (Accept: application/json).
How it compares to other codes
- 415 Unsupported Media Type: Deals with the request payload sent by the client. 406 deals with the response payload desired by the client.