If a web server doesn't have a MIME type added for a file that a client tries to download, what (if any) http status code would be returned?
It suggests here it could be 415, although the answer isn't definite:
HTTP status code for unaccepted Content-Type in request
The answer is "415 Unsupported Media Type" if your question is "what is the correct status code for a request if its body is content-encoded in the media type the server cannot accept."
RFC 2616 and draft-ietf-httpbis-p2-semantics-21.txt says:
If the content-coding of an entity in a request message is not
acceptable to the origin server, the server SHOULD respond with a
status code of 415 (Unsupported Media Type).
But If your question is "what is the correct status code if the server cannot respond with an entity body which is content-encoded in the media-type requested by Accept request header", the answer is "406 Not Acceptable"
RFC 2616 says:
If no Accept header field is present, then it is assumed that the
client accepts all media types. If an Accept header field is present, and if the server cannot send a response which is acceptable
according to the combined Accept field value, then the server SHOULD
send a 406 (not acceptable) response.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With