Specify supported media types when sending "415 unsupported media type"

deamon picture deamon · Jul 27, 2010 · Viewed 11.8k times · Source

If a clients sends data in an unsupported media type to a HTTP server, the server answers with status "415 unsupported media type". But how to tell the client what media types are supported? Is there a standard or at least a recommended way to do so? Or would it just be written to the response body as text?

Answer

Donal Fellows picture Donal Fellows · Jul 27, 2010

There is no specification at all for what to do in this case, so expect implementations to be all over the place. (What would be sensible would be if the server's response included something like an Accept: header since that has pretty much the right semantics, if currently in the wrong direction.)