HTTP 415

415 Unsupported Media Type

Client Error

The server refuses to process the request because the payload's media type is not supported. The 415 response should include an Accept-Patch or Accept-Post header (depending on the method) listing the media types the endpoint does accept. This is the right answer when a JSON API receives form-encoded data or when an image upload endpoint receives an unsupported file format, not when the data is well-formed but semantically wrong.

When does this happen?

Return 415 when the Content-Type or Content-Encoding of the request body is one your handler cannot process. Common cases include sending application/x-www-form-urlencoded data to an endpoint that only parses JSON, sending an unsupported image format to an upload endpoint, or sending gzip-encoded payload to a server that does not decompress. Some APIs also return 415 for Accept-header mismatches on responses, although that is more conventionally 406. Browsers do not surface 415 specifically. Clients see a failure and must interpret the status. APIs should include an Accept-Post or Accept-Patch header in the response listing supported media types so clients can self-correct without guessing.

Common causes

How to fix it

Real-world examples

Client POSTs JSON to /v1/users without a Content-Type header.
Server returns 415 because it cannot determine the body format. Client adds Content-Type: application/json and the request succeeds.
Mobile app uploads a HEIC photo to an endpoint that only accepts JPEG and PNG.
Server returns 415 with Accept-Post: image/jpeg, image/png. App transcodes the photo to JPEG before retrying.
Old SDK sends form-encoded credentials to a JSON-only login endpoint.
Server returns 415. The SDK is patched to send application/json with the same fields.
Client sends Content-Encoding: br on a body the server does not know how to decompress.
Server returns 415. Client drops the encoding header and resends the body as identity-encoded.
Multipart upload missing the boundary parameter in Content-Type.
Server returns 415 because it cannot parse the body. Client regenerates the request with a proper multipart/form-data; boundary=... header.

How it differs from related codes

HTTP 400

400 means the body could not be parsed at all (malformed JSON, broken framing). 415 means the body is well-formed but the type is unsupported.

HTTP 422

422 means the data is well-formed and the type is supported, but the values fail business validation. 415 is upstream of 422. You cannot fail validation if the type is wrong.

HTTP 406

406 is the inverse: the server cannot produce a response in the media type the client asked for (Accept header mismatch). 415 is about the request body's Content-Type, not the response.

Related status codes

400 405 422 500

See HTTP 415 in your redirect chains?

Check your URLs with checkredirects.io