HTTP 415 Unsupported Media Type

The body is in a format the endpoint does not accept — usually a Content-Type mismatch.

Defined in RFC 9110 §15.5.16 — 415 Unsupported Media Type · MDN reference

Where you meet HTTP 415 in production

Posting form-encoded data to a JSON-only endpoint, uploading a file type the server will not take, or omitting Content-Type entirely and having the server refuse to guess.

Why you would test it

Frequently caused by the client, not the server: a forgotten Content-Type header, or a form encoding where JSON was expected.

What your client should do about a 415

Do not retry unchanged. Fix the Content-Type header or convert the payload. Most occurrences are a missing header rather than genuinely unsupported content, which makes it worth logging the header you actually sent.

415 versus the codes it gets confused with

Endpoints that return 415

1 endpoint in this playground answers with 415. Every one is free, needs no signup, and can be called from the browser or with curl.

Questions about HTTP 415

Does the charset matter?
Sometimes. application/json and application/json; charset=utf-8 are treated as equivalent by most servers and as different by some strict ones.
What should the response include?
The media types that are supported — an Accept-Post header or a body listing them.

Other client error codes

All HTTP status codes · All 39 mock REST APIs · Getting started guide

Last updated