HTTP 415 Unsupported Media Type — Content-Type Mismatch
Warning4xx client error
Overview
HTTP 415 Unsupported Media Type means the server refuses the request because the Content-Type of the request body is not supported by the endpoint.
Key Details
- Server cannot process the request body format specified in Content-Type header
- Common when sending JSON to an endpoint that expects form data or vice versa
- API endpoints often accept only specific Content-Types (application/json, multipart/form-data)
- Missing Content-Type header can also trigger 415 on strict servers
- Different from 406 Not Acceptable which is about response format (Accept header)
Common Causes
- Sending application/json when the server expects application/x-www-form-urlencoded
- Missing Content-Type header on POST/PUT request
- Sending XML to a JSON-only API endpoint
- File upload without multipart/form-data Content-Type
Steps
- 1Check API documentation for accepted Content-Type values
- 2Set Content-Type header explicitly: Content-Type: application/json
- 3For file uploads, use Content-Type: multipart/form-data with boundary
- 4In curl: curl -H 'Content-Type: application/json' -d '{"key":"value"}' URL
- 5Verify your HTTP library is not overriding the Content-Type you set
Tags
http415unsupported-media-typecontent-typeapi
More in 4xx Client Error
http-400-bad-requestHTTP 400 Bad Request — What It Means & How to Fix It
Errorhttp-401-unauthorizedHTTP 401 Unauthorized — What It Means & How to Fix It
Errorhttp-402-payment-requiredHTTP 402 Payment Required — What It Means & How to Fix It
Errorhttp-403-forbiddenHTTP 403 Forbidden — What It Means & How to Fix It
Errorhttp-404-not-foundHTTP 404 Not Found — What It Means & How to Fix It
Errorhttp-405-method-not-allowedHTTP 405 Method Not Allowed — What It Means & How to Fix It
ErrorFrequently Asked Questions
415 is about the request Content-Type (what you send). 406 is about the Accept header (what you want back).