406 vs 415: Not Acceptable vs Unsupported Media Type
Both are content-type mismatches, in opposite directions. 406 is about the response format you asked for (Accept); 415 is about the request body format you sent (Content-Type).
406
HTTP 406 Not Acceptable
The server can’t produce a response in any format listed in the request’s Accept headers.
Causes & fixes →
415
HTTP 415 Unsupported Media Type
The server refuses the request because the body’s Content-Type isn’t one it accepts.
Causes & fixes →| 406 | 415 | |
|---|---|---|
| Header involved | Accept (what you want back) | Content-Type (what you sent) |
| Direction | Response format | Request body format |
| Typical fix | Ask for application/json | Send JSON with Content-Type: application/json |
Rule of thumb
Check Accept for 406 and Content-Type for 415.