Skip to content

unsupported_media_type

HTTP 415 · code unsupported_media_type

The body is not in a format the endpoint accepts.

Sent by photon.DecodeJSON when the request declares a Content-Type other than application/json or a +json type (a request with no Content-Type is accepted). Refusing other types is also a CSRF defence: a browser form cannot send application/json cross-site without a preflight.

Send the body with Content-Type: application/json.

{
"type": "https://photon.agenticmarket.dev/errors/unsupported_media_type",
"title": "unsupported media type",
"status": 415,
"code": "unsupported_media_type"
}

Match on the code field rather than on title, which is meant for people and may change. See all error codes.