What it means
The server won't accept the body's format, given by Content-Type, or its encoding, given by Content-Encoding. It may list the formats it does accept in Accept, Accept-Post or Accept-Encoding.
Why you're seeing it
- Sending JSON without
Content-Type: application/json. - Sending form data to an endpoint that only reads JSON, or the reverse.
- A compressed body the server can't decode.
How to fix it
- Set
Content-Typeto match the body. - In curl,
--jsonsets the header for you;-dalone sendsapplication/x-www-form-urlencoded.
Example response
HTTP/1.1 415 Unsupported Media Type Accept-Post: application/json Content-Length: 0