DevToolPal
EN
4xx Client errors

415 Unsupported Media Type

What it means

The server refuses the request because the body's media type (Content-Type) or encoding is not supported.

Common causes

  • Sending JSON without Content-Type: application/json
  • Form-encoded body to a JSON-only API
  • Unsupported Content-Encoding such as brotli on upload

How to fix it

As a client or visitor

Set the correct Content-Type header for the body you send, and match the format the API documents.

As the site or API owner

List accepted types in Accept-Post or Accept-Patch, and give a clear message.

Example response

HTTP/1.1
HTTP/1.1 415 Unsupported Media Type
Date: Tue, 07 Oct 2025 09:30:00 GMT
Server: nginx
Accept-Post: application/json
Content-Type: application/problem+json

{
  "type": "about:blank",
  "title": "Unsupported Media Type",
  "status": 415,
  "detail": "Send the body as application/json."
}

Specification

RFC 9110 §15.5.16

FAQ

› Why does fetch() get 415 with a JSON body?

fetch sends text/plain for string bodies unless you set headers: {'Content-Type': 'application/json'}.

› 415 vs 400?

415 is specifically the wrong body type; 400 is a malformed request in general.