4xx Client Error

HTTP 415 Unsupported Media Type

The media format of the requested data is not supported by the server, so the server is rejecting the request. The Content-Type or Content-Encoding of the request is not supported.

Common Causes

  • Sending JSON when the server expects form data
  • Missing or incorrect Content-Type header
  • Uploading a file format the server doesn't accept
  • Sending XML to a JSON-only API endpoint

How to Fix

  1. 1Set the correct Content-Type header (e.g., application/json)
  2. 2Check API documentation for accepted media types
  3. 3Convert data to a supported format before sending

Example

HTTP 415 Unsupported Media Type
POST /api/data HTTP/1.1
Content-Type: text/plain

→ 415 Unsupported Media Type
→ "Expected application/json"

Related Client Error Codes