Skip to content
4xx Client Error

415 Unsupported Media Type

The body format named in `Content-Type` is one the endpoint does not accept.

What causes it

  • Sending JSON without `Content-Type: application/json`.
  • Sending `application/x-www-form-urlencoded` to a JSON-only API, or vice versa.
  • A missing `charset` on a server that insists on one.

How to fix it

  • Set `Content-Type` explicitly. `fetch()` defaults to `text/plain` for a string body, which is the single most common cause of this error.

At a glance

Class
4xx Client Error
Reference
RFC 9110 §15.5.16
Standardised
Yes
Retry the request?
No — fix the request

Other 4xx client error codes

Back to the full HTTP status code reference