{ }HttpStatus.com

415 Unsupported Media Type

The server refuses the request because the payload's Content-Type or encoding is not supported by the target endpoint.

Defined in RFC 9110 §15.5.16

What 415 means

415 Unsupported Media Type means the server refuses the request because the payload's format, its Content-Type, or an encoding named in Content-Encoding, is not one the target resource and method support, even though the request is otherwise well-formed. It is specifically about the format of what the client sent, which is what distinguishes it from 406, which is about the format the client asked to receive back via the Accept header.

The typical cause is a client sending XML, form-urlencoded data, or a proprietary format to an API that only accepts application/json, or omitting the Content-Type header entirely and forcing the server to guess incorrectly. File upload endpoints commonly enforce this too, rejecting an uploaded file whose declared or sniffed MIME type isn't on an explicit allowlist, a CSV importer rejecting a spreadsheet file, for instance, even though both are spreadsheet formats to a human.

A subtler cause is an incorrect or missing charset parameter on an otherwise-correct Content-Type; application/json without charset=utf-8 is technically fine by default, but a mismatched charset on a text format can cause parsing to fail. API versioning schemes that encode the version inside the media type, such as application/vnd.example.v2+json, also produce 415 when a client requests a version the server has stopped accepting, which is functionally a deprecation signal wearing a content-type error's clothing.

Common causes

  • The client sent a Content-Type, such as XML or form-urlencoded, that the endpoint doesn't accept.
  • The Content-Type header is missing entirely, so the server cannot determine how to parse the body.
  • The Content-Type's charset parameter doesn't match the body's actual encoding.
  • An uploaded file's MIME type isn't on the server's explicit allowlist for that endpoint.
  • A versioned media type in Content-Type, such as application/vnd.api.v2+json, names a version the server no longer accepts.

How to fix a 415

If you are the client (browser user or API caller)

  • Set the Content-Type header to a format the endpoint's documentation lists as supported.
  • Verify the payload is actually encoded in the format the Content-Type header claims.
  • Check the API's changelog for media-type support changes if a previously working request now fails.

If you run the server

  • Document supported Content-Types explicitly and list them in the 415 response body.
  • Validate Content-Type early, before deep parsing logic runs, so the error is immediate and clear.
  • Support content negotiation for multiple input formats where practical, rather than accepting only one.

Example

POST /api/orders HTTP/1.1
Host: api.example.com
Content-Type: application/xml

<order><item>widget</item></order>

HTTP/1.1 415 Unsupported Media Type
Content-Type: application/json

{"error": "unsupported_media_type", "accepted": ["application/json"]}
An XML payload is rejected because the endpoint only accepts JSON bodies.

Try it live

Our free status responder returns a real HTTP 415 you can point tests, monitors or a browser at.

GET https://mcp.httpstatus.com/status/415

Related status codes

Tools for debugging this