# unsupported_media_type

The request body is not of a media type the operation reads (415).

## Meaning

Written before the handler runs and before the body is read: an operation that
reads a JSON body was sent one whose `Content-Type` is not `application/json`
(a form, plain text, or no `Content-Type` at all). `detail` names the media type
it reads. Form endpoints (token, PAR, introspection, revocation) answer a body
of another type with their own OAuth error instead, and the hosted-UI endpoints
refuse one as a cross-site request.

## Impact

The request did nothing. It is a bug in the client; the dashboard, the hosted UI
and a conforming client always send the declared media type.

## Diagnosis

1. Read `detail` and compare it with the request's `Content-Type`.
2. The refusal is recorded as `http.request.screened` with reason
   `invalid_request` and cause `media_type_unsupported`, under the request id.

## Mitigation

- As a client developer: send the body as `application/json` with that
  `Content-Type`. `curl -d` sends a form; add
  `-H 'Content-Type: application/json'`. Do not retry unchanged.

## Escalation

Escalate when a request sent with `Content-Type: application/json` is refused.
Open an issue with the request id, the endpoint, the request's headers with
secrets removed, and the server version.

---

[Problem code runbooks](https://www.nauthera.io/docs/v1/runbooks/problems) · Generated from [`internal/runbook/problems.yaml`](https://github.com/nauthera/nauthera-server/blob/main/internal/runbook/problems.yaml) in nauthera-server.
