HTTP 415 Unsupported Media Type means the server refuses to accept the request because the Content-Type of the request body is not supported. For example, sending XML to an endpoint that only accepts JSON.
415 Unsupported Media TypePOST /upload HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0
Accept: text/html
Content-Type: image/bmp
Content-Length: 204800
[binary file data]HTTP/1.1 415 Unsupported Media Type
Content-Type: text/html; charset=utf-8
<!doctype html>
<html>
<body>
<h1>415 Unsupported Media Type</h1>
<p>This file type is not supported. Please upload a JPEG or PNG image.</p>
</body>
</html>Check the API documentation for the expected Content-Type and set it in your request.
curl -X POST -H 'Content-Type: application/json' -d '{"key":"value"}' https://api.example.com/The API documentation should list which content types are accepted for each endpoint.
The request specifies a Content-Type the server does not support for this endpoint.
The request body does not have a Content-Type header and the server cannot determine the format.
| Specification | Section |
|---|---|
| HTTP Semantics | RFC 9110 §15.5.16 |
This reference was compiled from official RFCs, protocol specifications, and hands-on troubleshooting experience. AI tools were used primarily for formatting and organizing the content on the page.