files/en-us/web/http/reference/status/415/index.md
The HTTP 415 Unsupported Media Type client error response status code indicates that the server refused to accept the request because the message {{Glossary("HTTP Content", "content")}} format is not supported.
The format problem might be due to the request's indicated {{HTTPHeader("Content-Type")}} or {{HTTPHeader("Content-Encoding")}}, or as a result of processing the request message content.
Some servers may be strict about the expected Content-Type of requests.
For example, sending UTF8 instead of UTF-8 to specify the {{glossary("UTF-8")}} charset may cause the server to consider the media type invalid.
415 Unsupported Media Type
In the following example, the {{HTTPHeader("Content-Type")}} header is missing entirely:
POST /comments HTTP/1.1
Host: example.com
Content-Length: 23
{
"user": "belgin",
"comment": "LGTM!"
}
If the server implementation expects at least a MIME type Content-Type: application/json; for the request at that endpoint, it may send the following response:
HTTP/1.1 415 Unsupported Media Type
Date: Fri, 28 Jun 2024 12:00:00 GMT
Server: Apache/2.4.41 (Ubuntu)
Accept-Post: application/json; charset=UTF-8
Content-Length: 0
In the following example, the {{HTTPHeader("Content-Type")}} header is incorrectly set to URL-encoded form data when the {{Glossary("HTTP Content", "content")}} is in the request body instead:
POST /comments HTTP/1.1
Host: example.com
Content-Length: 23
Content-Type: application/x-www-form-urlencoded
{
"user": "belgin",
"comment": "LGTM!"
}
In this case, the server responds with a 415, with the required content type for the request in the {{HTTPHeader("Accept-Post")}} header:
HTTP/1.1 415 Unsupported Media Type
Date: Fri, 28 Jun 2024 12:00:00 GMT
Server: Apache/2.4.41 (Ubuntu)
Accept-Post: application/json; charset=UTF-8
Content-Length: 0
{{Specifications}}