LightAtom

415 Unsupported Media Type: How to Fix It

The server rejected the request body because of its format, almost always a missing or wrong Content-Type header.

415 Unsupported Media Type

You sent data in a format the server doesn't accept for this endpoint, or didn't say what format it was. The Content-Type header is the usual culprit.

Quick checks

  • Check the Content-Type header your client sends.
  • Check the API docs for the expected format.

If you’re visiting the site

  1. Upload a supported file type

    1. If an upload fails, convert the file to a type the site lists (for example JPEG or PNG instead of HEIC).

If you run the site

  1. Send the right Content-Type

    1. JSON: Content-Type: application/json. Forms: application/x-www-form-urlencoded or multipart/form-data.
    2. With curl, -d defaults to form encoding; add -H 'Content-Type: application/json' for JSON, or use --json (curl 7.82+).
  2. Check encoding

    1. Some APIs reject Content-Encoding: gzip bodies or unexpected charsets.

Still not working?

If the header is right and the server still returns 415, the endpoint may not support that operation's format at all; check the docs or ask the provider.

See what’s happening

LightAtom's connections view shows which server your app talks to, to confirm requests reach the intended API.

Frequently asked questions

What causes 415 Unsupported Media Type?

A request body whose Content-Type the server doesn't handle, often JSON sent without the application/json header, or a file type the endpoint doesn't accept.

How do I send JSON with curl?

curl --json '{"a":1}' https://api.example.com/ sets the right headers (curl 7.82 and later, including the curl in macOS). On older versions, add -H 'Content-Type: application/json' with -d.

Is 415 the same as 406?

No. 415 is about the format you sent. 406 Not Acceptable is about the format you asked to receive (the Accept header).

LightAtom team

The people who build LightAtom, a network monitor for macOS.