415 Unsupported Media Type

The body is in a format the server does not support for this resource and method.

Status

HTTP/1.1 415 Unsupported Media Type

Details

415 rejects the Content-Type of the request, not its contents. An endpoint that consumes application/json refuses a body sent as text/plain or as a form encoding, and an image endpoint refuses a format it cannot decode.

A frequent variant is the missing header: some frameworks default to application/x-www-form-urlencoded when Content-Type is absent, which then fails against a JSON-only endpoint even though the body itself is perfectly valid JSON.

Headers

Common causes

How to fix it

As the client

As the server

Examples

POST /api/v2/order HTTP/1.1
Host: api.example.com
Content-Type: text/plain

product_id=isp-us

HTTP/1.1 415 Unsupported Media Type
Accept-Post: application/json
Content-Type: application/json; charset=utf-8

{"error":"unsupported_media_type","supported":["application/json"]}

Specifications

RFC 9110 §15.5.16

See also