client error RFC 9110

HTTP 415 Unsupported Media Type

The Content-Type of the request body is not one the server can process.

What it means

The server understood the URL and method but the Content-Type header identifies a format it doesn't handle. For example, sending `Content-Type: application/xml` to a JSON-only API. Also thrown when Content-Type is missing on POST/PUT.

When servers send it

  • POST with `Content-Type: application/xml` to a JSON API
  • Uploading an image type the endpoint doesn't accept
  • Missing Content-Type header entirely

What the client does

Retries with the correct Content-Type. Reads the `Accept-Post` or `Accept` header if provided.

Common causes

  • Client library not setting Content-Type automatically
  • Sending `text/plain` when server expects `application/json`
  • File uploads without proper `multipart/form-data` boundary

How to fix it

  • 1.Explicitly set `Content-Type: application/json` (or whatever the API expects)
  • 2.Check the API docs for supported Content-Types
  • 3.For file upload: ensure the FormData boundary is set (fetch does this automatically; some libraries don't)

Similar codes

← All HTTP status codes · HTTP status cheat sheet · HTTP headers reference