Skip to content

415 Unsupported Media Type

Meaning

The request entity has a media type which the server or resource does not support. The server cannot process the request payload format.

When to Use

When the client sends data in a format that the server does not accept or cannot process (for instance, sending XML to an endpoint that only handles JSON).

Example

POST /api/upload with Content-Type: text/xml to a JSON API returns 415 Unsupported Media Type if the server refuses to process XML payloads.

When Not to Use

Do not use if the issue is about content that is syntactically correct but semantically unprocessable (use 422 in such cases). Also do not use if the media type is fine but something else failed (then use the appropriate code).

Source

RFC 9110


Released under the MIT License.