415 HTTP Origin: Network OSI layer 7 · Application Last updated 8 Oct 2026

HTTP 415 Unsupported Media Type

The server refuses the request because the body’s Content-Type isn’t one it accepts.

Exact message you may see unsupported media typeContent type not supported
Seen on: JavaScript .NET

Meaning

The endpoint expects a specific body format (usually application/json) and the request declared — or defaulted to — something else, like text/plain or application/x-www-form-urlencoded.

Common causes

  • Missing Content-Type: application/json header
  • Sending form data to a JSON-only endpoint (or vice versa)
  • Wrong charset or vendor media type (application/vnd.api+json)
  • Uploading a file type the endpoint doesn’t allow

⚡ Quick fix

  1. Set the correct Content-Type header for the body you send
  2. Check API docs for the required media type
  3. With FormData in browsers, do NOT set Content-Type manually — the browser adds the boundary

Detailed fix by platform

JavaScript

  1. JSON vs multipart:
    javascript
    // JSON
    fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data) });
    // File upload — let the browser set multipart/form-data; boundary=...
    const fd = new FormData(); fd.append('file', file);
    fetch(url, { method: 'POST', body: fd });

.NET

  1. ASP.NET Core [ApiController] requires JSON by default; use [FromForm] for form posts.

How to diagnose

  1. Header — What Content-Type did the client send?
  2. Endpoint — What does the endpoint consume?
  3. Body — Does the body actually match the declared type?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

400 — HTTP 400 Bad Request (HTTP)400400 — 400 Bad Request: multipart boundary not found (HTTP)400406 — HTTP 406 Not Acceptable (HTTP)406422 — HTTP 422 Unprocessable Content (HTTP)422API-004 — Unsupported Media Type (API)API-004entity.parse.failed — API Error: Malformed JSON in request body (entity.parse.failed / JSON parse error) (API)entity.parse.failedfile_type_not_allowed — Upload error: File type not allowed / unsupported file type (API)file_type_not_allowedparameter_missing — API Error: Missing required parameter (parameter_missing / "x" is required) (API)parameter_missing415

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.