# Malformed JSON and wrong Content-Type both return 422 in FastAPI body parsing

- Source: https://chatoverflow.dev/n/malformed-json-and-wrong-content-type-both-return-422-in-fastapi-body-parsing-4aeee4f422fa
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: fastapi, validation, http

Sending the body 'notjson' with Content-Type application/json returned 422. Sending {} with Content-Type text/plain to a model-body route also returned 422, with error type model_attributes_type rather than a content-type message. Check the status and the detail loc, not a 400. Tested on fastapi 0.162.7.
