Start free · Free tools · Fair usage limits
Browse Tools

Categories

Custom AI Solutions – AI2Flows
LIVE NEWS
Loading latest AI & SEO news…
Home›Tools›HTTP Status Codes Reference›HTTP 415 Unsupported Media Type
4xx Client Error

HTTP 415 Unsupported Media Type

HTTP 415 Unsupported Media Type means the server will not accept the request body’s format, as stated by its Content-Type header.

Quick answer

HTTP 415 Unsupported Media Type means the server will not accept the request body’s format, as stated by its Content-Type header. The most common case is sending JSON without Content-Type: application/json, or sending form data to an endpoint that only accepts JSON.

Last updated · Maintained by FreeAIToolz · How we test

What does HTTP 415 Unsupported Media Type mean?

The server checks Content-Type (and sometimes Content-Encoding) before parsing. A mismatch or missing header triggers 415 even if the body itself is valid.

Status code415
NameUnsupported Media Type
Class4xx Client Error
Defined inRFC 9110 §15.5.16
Cacheable by defaultNo, unless Cache-Control says so
Safe to retry automatically?No: change the request first
Related headersContent-Type, Accept-Post, Accept-Patch

What causes HTTP 415?

  • Missing Content-Type header.
  • Wrong type (text/plain or multipart/form-data sent to a JSON endpoint).
  • An unsupported Content-Encoding such as gzip on the request.

How do I fix HTTP 415?

  1. Send Content-Type: application/json with JSON bodies (fetch does not set it automatically).
  2. Document accepted types; respond with an Accept-Post or Accept-Patch header listing them.

What should a client do after HTTP 415?

Correct the Content-Type and resend.

Does HTTP 415 affect SEO?

No SEO impact.

Example 415 response

HTTP/1.1 415 Unsupported Media Type
Date: Mon, 01 Dec 2026 12:00:00 GMT
Content-Type: application/json

{"error":{"status":415,"message":"Unsupported Media Type"}}

How to return 415 Unsupported Media Type in code

Express (Node.js)

res.status(415).json({ error: 'Unsupported Media Type' });

Next.js route handler

return Response.json({ error: 'Unsupported Media Type' }, { status: 415 });

FastAPI (Python)

raise HTTPException(status_code=415, detail="Unsupported Media Type")

PHP

http_response_code(415);

Nginx

location = /example {
    return 415;
}

Other 4xx status codes

The request contains an error or cannot be fulfilled as sent. Fix the request before retrying.

Frequently asked questions

Why does fetch() get 415 when posting JSON?
fetch does not add Content-Type for string bodies. Add headers: { "Content-Type": "application/json" }.
415 vs 400?
415 is specifically about the body format. 400 covers other malformed requests.
Is 415 a client or server error?
415 is in the 4xx class, so it is classed as a client error: the request needs to change before it can succeed.