415 Unsupported Media Type
The server refuses the request because the body is in a format it cannot handle, as declared by Content-Type.
At a glance
- Status code
- 415 Unsupported Media Type
- Class
- 4xx, client error, the request itself is the problem
- Defined in
- RFC 9110
- Cacheable by default
- yes
- Response body
- Should list the media types that are accepted.
In detail
This is about the request body, not about what the client wants back. The code for that is 406.
Return an Accept-Post or Accept header naming what would work. The client then has something actionable instead of a guess.
Check the Content-Type actually sent. A missing charset, a stray boundary parameter, or text/plain from a client library default are the usual causes.
Examples
HTTP/1.1 415 Unsupported Media Type
Accept-Post: application/json
Content-Length: 0Things that catch people out
- 415 and 406 are constantly confused. 415 is what you sent, 406 is what you asked for.
- Some servers require an exact match, so application/json; charset=utf-8 fails against a check for application/json.
Try it: HTTP Request Builder
Build a request with any method, headers and body, send it, and read the status line the server returns.
HTTP Request Builder
LOCAL · Browser-OnlyBuild and test HTTP requests with custom headers and body
Authentication
Headers
Generate Code
curl -X GET 'https://api.example.com/endpoint' \
-H 'Content-Type: application/json'Showing a sample URL. Enter your endpoint above to update the snippet.
Related HTTP status codes
All http status codes →406 Not Acceptable
The server cannot produce a representation that matches the Accept headers the client sent.
400 Bad Request
The server refused the request because it was malformed. The client must change something before retrying, because repeating the same bytes will fail.
422 Unprocessable Content
The request was well-formed and understood, but the values inside it failed validation. The syntax was fine and the semantics were not.
416 Range Not Satisfiable
The Range header asked for bytes that lie outside the resource, for example bytes 5000 to 6000 of a 2KB file.
417 Expectation Failed
The server cannot meet the requirement in the Expect header, which in practice always means Expect: 100-continue.
418 I'm a Teapot
A joke code from the Hyper Text Coffee Pot Control Protocol. It is not part of HTTP and should never be returned by a real service.
Tools for this
- HTTP Request Builder Free online HTTP request builder - build and test HTTP requests with custom headers and body
- HTTP Headers Checker Free online HTTP headers checker - view HTTP response headers for any URL