Unsupported Media Type — the server rejects the request payload format
What 415 Means
The 415 error on the HTTP Status-Codes indicates unsupported media type — the server rejects the request payload format. This typically occurs due to sending an xml body to an api expecting strictly json format.
A 415 Unsupported Media Type indicates that the server refuses to accept the request because the payload format is in an unsupported configuration. The server fundamentally understands the request mechanism, but cannot parse the data encapsulation chosen by the client.
Technical Background
The 415 status resolves confusion between bad data and bad data formatting. It clearly communicates to the client that the action might be entirely permissible, but the packaging layer of the transmission is rejected by the application.
This condition is heavily gated by headers. Servers validate the incoming Content-Type header against their known supported schemas. If a client sends perfectly valid JSON but mistakenly labels it application/xml, the server typically blocks it immediately with a 415.
Many modern API gateways proactively enforce Content-Type matching before incoming traffic even reaches the core business logic, making 415 a foundational layer of edge security and input sanitization.
Common Causes
- Sending an XML body to an API expecting strictly JSON format
- Uploading a WebP image to a receiver that only processes JPEGs
- Omitting or sending an incorrect Content-Type header on a POST
- A frontend client relies on a deprecated media serialization scheme
Typical Scenarios
- A script attempts to send raw text data without setting the mandatory Content-Type application/json header
- A user tries to process an ancient video format against a modern encoding API
- A webhook delivers data encoded improperly for the receiving server endpoint
What to Know
A 415 is almost exclusively a client-side formatting error that is trivial to trace. Resolving it rarely requires structural code changes; it usually involves ensuring the HTTP headers accurately reflect the payload content or converting the file format prior to transmission.
Frequently Asked Questions
Common questions about HTTP 415 error
Your code is likely sending an empty or incorrect Content-Type header. If the API expects application/json, you must explicitly declare that format in the request headers.
Usually no. A 415 is the server correctly identifying that you have sent data in a format it is not configured to support or understand.
A 400 broadly means the request is malformed. A 415 highly specifically means the format is unsupported, such as trying to upload an audio file where an image belongs.