4xx Client Error
HTTP 415 Unsupported Media Type
The media format of the requested data is not supported by the server, so the server is rejecting the request. The Content-Type or Content-Encoding of the request is not supported.
Common Causes
- Sending JSON when the server expects form data
- Missing or incorrect Content-Type header
- Uploading a file format the server doesn't accept
- Sending XML to a JSON-only API endpoint
How to Fix
- 1Set the correct Content-Type header (e.g., application/json)
- 2Check API documentation for accepted media types
- 3Convert data to a supported format before sending
Example
HTTP 415 Unsupported Media Type
POST /api/data HTTP/1.1 Content-Type: text/plain → 415 Unsupported Media Type → "Expected application/json"
Related Client Error Codes
400
Bad Request
401Unauthorized
402Payment Required
403Forbidden
404Not Found
405Method Not Allowed
406Not Acceptable
407Proxy Authentication Required
408Request Timeout
409Conflict
410Gone
411Length Required
412Precondition Failed
413Content Too Large
414URI Too Long
416Range Not Satisfiable
417Expectation Failed
418I'm a Teapot
421Misdirected Request
422Unprocessable Content
423Locked
424Failed Dependency
425Too Early
426Upgrade Required
428Precondition Required
429Too Many Requests
431Request Header Fields Too Large
451Unavailable For Legal Reasons