406 vs 415
Not Acceptable vs Unsupported Media Type
406Not Acceptable
Picky eater alert! You asked for something in a format the server can't serve. Like ordering sushi at a pizza place.
HTTP/1.1 406 Not Acceptable
Content-Type: application/json
{"available": ["application/json", "application/xml"]}415Unsupported Media Type
Can't read that! Like handing someone a Betamax tape in 2024. The server doesn't speak that format.
HTTP/1.1 415 Unsupported Media Type
Accept: application/jsonπ½οΈ406Not Acceptable
πΌ415Unsupported Media Type
Description
The server cannot produce a response matching the list of acceptable values defined in the request's headers.
Common Causes
- Accept header doesn't match available formats
- Language not supported
- Content negotiation failed
Description
The media format of the requested data is not supported by the server.
Common Causes
- Sending XML when JSON expected
- Wrong Content-Type header
- Unsupported file format