The 415 Unsupported Media Type error means that the request sent to an origin server has been refused. It usually has to do with using a format not supported by the server.
As part of our Server Support Services, we do help customers solve HTTP related errors on a daily basics.
Let us Know more about this error and how to solve it.
More about 415 Unsupported Media Type error
The 415 Unsupported Media Type error as earlier noted is usually triggered when an incorrect format is used in a request. In this case, the server did not recognize any valid Content-Encoding or Content-Type headers as part of such request.
It is important for the Content-Encoding header to be included in any request to tell the server more about the data it is transmitting.
Let us take the contact form of a website for example. When the form is filled and submitted, a POST method which sends data to the server conveys data with its Content-Encoding header to tell the server that it is in the correct format. Therefore, the request is sent successfully in this case.
In the case where the Content-Encoding header is not specified, this 415 Unsupported Media error will occur.
How to solve 415 Unsupported Media Type error
To fix this issue, consider the following recommendations;
i. Ensure that a valid Content-Encoding header value is included in request to server.
ii. Ensure that the server can process such a request including the Content-Type header.
iii. Check the Accept header in the request you are transmitting to the server.
In conclusion, it is important for a request to contain valid Content-Type value before being sent to the server to prevent this error and to enable the server to understand the data sent to it.