# starlette.exceptions.HTTPException: 400 Bad Request: There was an error parsing the body

- **ID:** `python/starlette-multiple-json-body`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

请求体不是有效的 JSON 或格式错误。

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   try:\n    data = await request.json()\nexcept Exception:\n    return JSONResponse({'error': 'Invalid JSON'}, status_code=400)
   ```
2. **** (85% success)
   ```
   from pydantic import BaseModel\nclass Item(BaseModel):\n    name: str\n    price: float\nitem = Item(**data)
   ```

## Dead Ends

- **** — 可能重复解析，且处理复杂。 (50% fail)
- **** — 导致后续逻辑错误。 (80% fail)
