The HTTP 415 Unsupported Media Type error means that the server refuses to accept the request because the Content-Type of the request is in an unsupported format.
There are a few reasons why this error might occur:
The Content-Type header is missing from the request.
The Content-Type header is set to an unsupported value.
The Content-Type header is set to a supported value, but the request body is in an unsupported format.
This error can occur when making a POST or PUT request. It is also possible to receive this error when making a GET request, if the server is configured to return 415 errors for unsupported media types.
You are here because you have a question about:
- error code 415
- http 415
1. Check the request headers and make sure they are correct
- Check the request headers for any invalid or missing values.
- If the header values are correct, then check the HTTP status code.
- If the HTTP status code is 415, then the request is invalid and should be rejected.
2. Check the request body and make sure it is valid
The first step is to check the request body. If it is not valid, then the http 415 error will be generated. The following is a list of common errors that can occur in the request body:
- The request body is too large.
- The request body is not in the correct format.
- The request body is not valid JSON.
- The request body is not valid XML.
3. Check the request method and make sure it is valid
The HTTP request method is a required field in the HTTP request header. The HTTP request method must be a valid HTTP method. The following table lists the valid HTTP request methods. HTTP Request Method Valid Methods GET POST PUT DELETE PATCH MERGE CONNECT OPTIONS HEAD The HTTP request method must be one of the listed valid HTTP methods. If the request method is not one of the listed valid HTTP methods, then the request is invalid and your application should return HTTP 415 (Method Not Allowed) error.
If the answers above didn't work then you should also try:
- Check the request URL and make sure it is valid
- Check the server settings and make sure the file type is allowed