Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 245
deamon Avatar asked Jul 27 '10 11:07

deamon


People also ask

How do you handle 415 unsupported media type?

Fixing 415 Unsupported Media Type errorsEnsure that you are sending the proper Content-Type header value. Verify that your server is able to process the value defined in the Content-Type header. Check the Accept header to verify what the server is actually willing to process.

Is 415 unsupported media type?

The HTTP 415 Unsupported Media Type client error response code indicates that the server refuses to accept the request because the payload format is in an unsupported format. 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.

How do you find unsupported media?

To see your unsupported videos: On your Android phone or tablet, open a browser. Go to https://photos.google.com/unsupportedvideos. Select the videos you want to download or delete. If you delete a video, it will be deleted from Google Photos, but not from your device if you downloaded a copy.


1 Answers

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.)

like image 106
Donal Fellows Avatar answered Sep 28 '22 04:09

Donal Fellows