415 Unsupported Media Type
The server refuses the request because of its Content-Type (or Content-Encoding) — the body format itself, before validation even starts. Sending JSON with a text/plain header, or multipart when JSON is expected, lands here.
What usually causes it
- Missing Content-Type: application/json on a JSON POST
- Charset suffix confusing a strict parser (application/json; charset=utf-8 vs exact-match checks)
- Sending form-encoded data to a JSON-only endpoint (default of many HTTP clients)
How to debug and fix it
- Set the Content-Type explicitly in the client; don't rely on library defaults.
- Compare with a working curl: -H 'Content-Type: application/json' -d '{...}'.
- Server-side, accept the standard charset suffix — rejecting it violates the spirit of the spec and breaks many clients.
Easily confused with
Debugging an API? Build and inspect requests, check response headers, or read the full status-code debugging guide.