Skip to main content
Version: 4.x

Unsupported media type

Type URIhttps://doc.expresso-ts.com/docs/errors/unsupported-media-type
HTTP status415

The route does not accept the Content-Type the request was sent with.

When it is sent​

A route declares the types it accepts with @Consumes(), and the request's Content-Type is not one of them. The framework sends this itself, with the code EXP2004.

{
"type": "https://doc.expresso-ts.com/docs/errors/unsupported-media-type",
"title": "Unsupported Media Type",
"status": 415,
"detail": "Content-Type \"text/plain\" is not supported by this route. Supported: application/json",
"instance": "/api/users",
"errorCode": "EXP2004"
}

What to do​

Send the body as one of the types named in detail, with the matching Content-Type header.

See Error responses for the shape of the document and how to turn it on.