DevToolsmith

HTTP 415 Unsupported Media Type

HTTP 415 Unsupported Media Type means the server doesn’t accept the request body’s format. The request contains an error or can’t be fulfilled. Retrying unchanged won’t help.

Class
4xx Client error
Standard
RFC 9110
Cacheable by default
No
Safe to retry
No
Go constant
http.StatusUnsupportedMediaType

What HTTP 415 means

The Content-Type of the request isn’t one the endpoint accepts, such as XML sent to a JSON API, or no Content-Type at all. It is about the format of what you send; 406 is about the format you ask to receive.

How to fix a 415 error

  • Set Content-Type: application/json when sending JSON. fetch() doesn’t set it automatically for a string body.
  • ASP.NET Core and Spring return 415 when the header is missing entirely.

Retrying

No. Fix the request first; sending it again unchanged will get the same response.

Example response

HTTP/1.1 415 Unsupported Media Type
Date: Wed, 21 Oct 2026 10:30:00 GMT
Content-Type: application/json

How to return 415

Node.js (Express)
res.status(415).json({ error: 'Unsupported Media Type' });
Python (FastAPI)
from fastapi import HTTPException

raise HTTPException(status_code=415, detail="Unsupported Media Type")
Go (net/http)
http.Error(w, http.StatusText(http.StatusUnsupportedMediaType), http.StatusUnsupportedMediaType)
nginx
location /private/ {
    return 415;
}

Related status codes

Other 4xx status codes

400 Bad Request · 401 Unauthorized · 402 Payment Required · 403 Forbidden · 404 Not Found · 405 Method Not Allowed · 406 Not Acceptable · 407 Proxy Authentication Required · 408 Request Timeout · 409 Conflict · 410 Gone · 411 Length Required · 412 Precondition Failed · 413 Content Too Large · 414 URI Too Long · 416 Range Not Satisfiable · 417 Expectation Failed · 418 I’m a Teapot · 421 Misdirected Request · 422 Unprocessable Content · 423 Locked · 424 Failed Dependency · 425 Too Early · 426 Upgrade Required · 428 Precondition Required · 429 Too Many Requests · 431 Request Header Fields Too Large · 444 No Response · 451 Unavailable For Legal Reasons · 499 Client Closed Request

See the full list of HTTP status codes.

Sources

Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.

Frequently asked questions

What does HTTP 415 Unsupported Media Type mean?

HTTP 415 Unsupported Media Type means the server doesn’t accept the request body’s format. The Content-Type of the request isn’t one the endpoint accepts, such as XML sent to a JSON API, or no Content-Type at all. It is about the format of what you send; 406 is about the format you ask to receive.

How do I fix HTTP 415?

Set Content-Type: application/json when sending JSON. fetch() doesn’t set it automatically for a string body. ASP.NET Core and Spring return 415 when the header is missing entirely.