Skip to the content

415 Unsupported Media Type

The server won't accept the body of the request because of its format, going by the Content-Type or Content-Encoding header.

Class
4xx Client error. The request is the problem: a wrong address, missing credentials, data the server can't accept.
Defined in
RFC 9110

What it looks like

HTTP/1.1 415 Unsupported Media Type
Accept: application/json

Share this tool:TwitterFacebookLinkedInWhatsAppEmail

What causes it

When the body is in a format the address doesn't take, or the Content-Type header is missing or wrong. The classic case is JSON posted without Content-Type: application/json, so that the server takes it for form data or plain text. A compressed body that the server can't unpack gets the same answer.

What to do about it

Set the Content-Type header to what the body really is and what the API documents. With curl, -d on its own sends application/x-www-form-urlencoded, so add -H "Content-Type: application/json". With fetch, a body made with JSON.stringify needs the header set by hand.

For an upload, check that the type of the file is one the server lists.

Not to be confused with

406 Not AcceptableThe reverse: the server can't produce a format the client accepts.
400 Bad RequestThe format is right, the content is broken.
422 Unprocessable ContentThe format is right and it can be read, but the values are not acceptable.

All codes are on the list of HTTP status codes, which can be searched by number and by word.

See all 12