Troubleshooting guide · http-status · Published 2026-08-15 · 3 min read

HTTP 415 Unsupported Media Type explained

Fix HTTP 415: check the request Content-Type, Accept expectations, and Content-Range upload handling when a server rejects a payload.

Flat editorial illustration showing a lantern-style status readout with a neat row of stacked directory rails, each rail marked with an abstract tally.
Illustration: this article at a glance.

The symptom

An API call or file upload returns 415 Unsupported Media Type. The request is well-formed and reaches the server, but the server refuses the payload because the media type does not match what the endpoint accepts. In most browsers the network tab shows a 415 on the failing request with the request body abandoned.

What 415 means

415 Unsupported Media Type signals a mismatch between the media type of the request payload and what the server expects or accepts. The server checks the Content-Type header against a whitelist for the resource, and rejects when the type is unsupported. It is different from 400 Bad Request (malformed syntax) and 411 Length Required (missing Content-Length).

Common causes

Fix the request

  1. Open the network tab and check the failing request's Content-Type header and body preview.
  2. Compare it with the endpoint contract. If the API expects JSON, set Content-Type: application/json and send a valid JSON body:
POST /api/items HTTP/1.1
Content-Type: application/json

{"name": "Widget", "sku": "W-100"}
  1. For file uploads, use the correct multipart framing, e.g. Content-Type: multipart/form-data; boundary=....
  2. Send a minimal request (curl, the REST client) with an explicit header to isolate whether the code or the framework is adding the wrong type.
curl -X POST -H "Content-Type: application/json" \
  -d '{"name":"Widget"}' https://api.example.com/api/items
  1. If the API is fine in the docs but rejects your SDK call, your HTTP client may be defaulting to a URL-encoded form where no Content-Type was set; set it explicitly.

Fix the server side

When you own the API, a 415 should be accompanied by a Content-Type or a response body that states the accepted types, and it must be returned only for genuinely unsupported media, never for a correctly-typed request. Validate the Content-Type early in the middleware, and return a clear "expected x, received y" message so clients can correct themselves, mirroring the diagnostic style of the 400 Bad Request guide. If clients upload in ranges, document the exact headers and framing required. Keep the acceptable media types small and explicit so 415 stays a precise contract signal rather than a mystery.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services