415 Error

A 415 Unsupported Media Type error is a webserver’s code for:

“I don't know how to read the file format or encoding you just sent me.”

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 .exe or .webp file to a service that only accepts .jpg or .pdf).
  • An API expected JSON (application/json) but the client sent XML (application/xml) or raw text (text/plain).
  • The client omitted the Content-Type header 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-Type and Content-Encoding headers.
    • Ensure your HTTP client explicitly sets Content-Type: application/json when sending JSON payloads.

Source: RFC 9110 Section 15.5.16 (HTTP Semantics)