# werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.

- **ID:** `python/flask-json-415-unsupported-media-type`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

request.get_json() called but the client sent no Content-Type: application/json header (common with curl or fetch defaults).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 2.x | active | — | — |
| 3.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   curl -X POST -H 'Content-Type: application/json' -d '{"a":1}' http://localhost:5000/api
   ```
2. **** (88% success)
   ```
   data = request.get_json(silent=True) or {}  # explicit fallback for non-JSON
   ```

## Dead Ends

- **** — Hides the contract bug and can produce confusing 400s on malformed bodies. (55% fail)
- **** — Returns wrong status; client still gets no data. (70% fail)
