# json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

- **ID:** `python/fastapi-request-body-malformed-json`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

客户端发送的请求体不是有效的 JSON，或者 Content-Type 不是 application/json。

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   from pydantic import BaseModel
class Item(BaseModel):
    name: str
@app.post('/items')
async def create(item: Item):
    return item
   ```
2. **** (95% success)
   ```
   import requests
requests.post(url, json={'name': 'test'})
   ```

## Dead Ends

- **** — FastAPI 可能仍然尝试解析 JSON，导致错误。 (60% fail)
- **** — 原始数据可能不是 JSON，解析仍会失败。 (70% fail)
