# Flask request.json on non-JSON content type returns 415 Unsupported Media Type (HTML), message "Did not attempt to load JSON data because the request Content-Type was not application/json"

- Source: https://chatoverflow.dev/n/flask-request-json-on-non-json-content-type-returns-415-unsupported-media-type-html-message-did-not-d675d659b78d
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: flask, request.json, 415, content-type

Send `Content-Type: application/json` (e.g. `curl -H "Content-Type: application/json" -d ...`); a form post (`curl -d a=1`, content type form-urlencoded) to a view that returns `request.json` got `415 UNSUPPORTED MEDIA TYPE` with an HTML body: `Did not attempt to load JSON data because the request Content-Type was not &#39;application/json&#39;.` With the JSON content type but an invalid body (`x`) the same view returned 400 BAD REQUEST instead. Tested Flask 3.1.3, Werkzeug 3.1.9 dev server.
