HTTP 415 Unsupported Media Type
HTTP 415 Unsupported Media Type means the server is refusing to process the request because the format of the request body — as declared by the Content-Type header — is not supported by the endpoint. The server can process the HTTP method and route, but cannot handle the media type of the body.
Quick reference
| Code | 415 |
|---|---|
| Name | Unsupported Media Type |
| Category | 4xx Client Errors |
| Specification | RFC 9110 §15.5.16 |
| IANA status | Assigned |
| Cacheable | No |
| Client action | Change the Content-Type header to a format the server accepts. Check the Accept header for supported types. |
| In-depth guide | HTTP 415 full guide → |
What HTTP 415 means
RFC 9110 defines 415 as indicating that the origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource. The format problem may be due to the request's indicated Content-Type or Content-Encoding.
415 is a server-side rejection based on format incompatibility, not a content validation failure. The server is saying: I do not know how to read what you sent. This is distinct from 422 Unprocessable Content, which means the server read the body successfully but the data values failed validation.
The server should include an Accept header in the 415 response listing the media types it does support, though this is optional per RFC 9110.
Common causes
Missing Content-Type header
A POST or PUT request with a body and no Content-Type header. Many servers default to application/octet-stream for requests without a content type, which is often not a supported type for the endpoint. Always set Content-Type explicitly when sending a body.
Wrong Content-Type for the body format
The most common cause: sending JSON with Content-Type: application/x-www-form-urlencoded, or sending form data with Content-Type: application/json. The server tries to parse the body as the declared type and fails. Match the Content-Type header to the actual format of the body.
API expects JSON but client sends XML
The endpoint only handles application/json but the client sends application/xml. Change the client to send JSON, or check the API documentation for supported formats.
Multipart form data without boundary parameter
When uploading files, the Content-Type must be multipart/form-data; boundary=<value>. The boundary parameter is generated automatically by browser form submissions and most HTTP client libraries — but a manually constructed request may omit it, causing 415.
Charset or encoding parameter mismatch
Some servers reject content types with unexpected charset or encoding parameters. Sending application/json; charset=utf-16 to a server that only accepts application/json; charset=utf-8 may produce 415.
How to fix a 415
- Check the Content-Type you are sending. Confirm it matches the actual format of the request body. JSON bodies need
application/json. Form fields needapplication/x-www-form-urlencoded. File uploads needmultipart/form-data. - Check what the server accepts. The 415 response may include an
Acceptheader listing supported media types. If not, check the API documentation. - Inspect the raw request. Use curl with
-vor browser DevTools to see the exactContent-Typebeing sent. Frameworks sometimes override the content type you set. - Check for content negotiation headers. Some endpoints also check
AcceptorAccept-Encodingheaders and return 415 or 406 for unsupported values. Ensure these headers are consistent with what the server supports.
415 vs 406 Not Acceptable
415 and 406 Not Acceptable are the two sides of content negotiation failure. 415 is about the request body format — what you send. 406 is about the response format — what you want to receive. A 415 means the server cannot process the format you sent in the body. A 406 means the server cannot produce the format you requested in the Accept header.
FAQ
What does HTTP 415 Unsupported Media Type mean?
HTTP 415 means the server does not support the format of the request body as declared by the Content-Type header. Set the correct Content-Type for the data you are sending.
How do I fix a 415 error?
Check that the Content-Type header matches the actual format of the request body. For JSON APIs, set Content-Type: application/json. Inspect the raw request to confirm the header is being sent correctly.
Can a 415 occur even when Content-Type is set?
Yes. If the Content-Type does not match the body format (e.g., claiming JSON but sending XML), or if the server only supports a specific subset of media types, a 415 can still occur with a Content-Type header present.
What is the difference between 415 and 406?
415 is about what you send (request body format). 406 is about what you want to receive (response format). Both are content negotiation failures but in opposite directions.
Related resources
On this site: HTTP 415 Unsupported Media Type — full guide · HTTP 406 Not Acceptable · HTTP 400 Bad Request · HTTP 422 Unprocessable Content · All 4xx client errors
Standards: RFC 9110 §15.5.16 · IANA HTTP Status Code Registry · MDN Web Docs: 415