- Home
- Tools
- Developer Tools
- HTTP Status Codes
- 415 Unsupported Media Type
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
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 Acceptable | The reverse: the server can't produce a format the client accepts. |
|---|---|
| 400 Bad Request | The format is right, the content is broken. |
| 422 Unprocessable Content | The 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.
Other 4xx codes
- 400 Bad Request
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Content Too Large
- 414 URI Too Long
- 416 Range Not Satisfiable
- 417 Expectation Failed
- 418 I'm a teapot
- 421 Misdirected Request
- 422 Unprocessable Content
- 423 Locked
- 424 Failed Dependency
- 425 Too Early
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons