HTTP status code for unaccepted Content-Type in request

It could be 415 Unsupported Media Type according to this list: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.16.

3rd party edit

From the current RFC9110 HTTP Semantics

The 415 (Unsupported Media Type) status code indicates that the origin
server is refusing to service the request because the content is in a
format not supported by this method on the target resource.

The format problem might be due to the request’s indicated
Content-Type or Content-Encoding, or as a result of inspecting the
data directly.

If the problem was caused by an unsupported content coding, the
Accept-Encoding response header field (Section 12.5.3) ought to be
used to indicate which (if any) content codings would have been
accepted in the request.

On the other hand, if the cause was an unsupported media type, the
Accept response header field (Section 12.5.1) can be used to indicate
which media types would have been accepted in the request.

Source RFC9110 – 415 unsupported media type

Leave a Comment