A 415 Unsupported Media Type error indicates that the origin server refuses to service the request because the payload is in a format not supported by this method on the target resource.
When sending data in a POST, PUT, or PATCH request, the client specifies the data type using the Content-Type header (such as application/json, multipart/form-data, or image/png). If the server does not support that format, it returns 415.
Determining why
- You tried uploading a file format the server doesn’t allow (such as uploading an
.exeor.webpfile to a service that only accepts.jpgor.pdf). - An API expected JSON (
application/json) but the client sent XML (application/xml) or raw text (text/plain). - The client omitted the
Content-Typeheader entirely.
Steps you could possibly take:
- Verify the file type - If uploading a document or image, make sure the file matches the exact extensions accepted by the site.
- If you are an API developer:
- Check the API documentation for required
Content-TypeandContent-Encodingheaders. - Ensure your HTTP client explicitly sets
Content-Type: application/jsonwhen sending JSON payloads.
- Check the API documentation for required