# RuntimeError: Request body is not available after the request has been consumed

- **ID:** `python/starlette-request-body-unavailable`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

在 Starlette 中多次读取请求体，例如在中间件和端点中，但流只能读一次。

## Version Compatibility

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

## Workarounds

1. **** (85% success)
   ```
   body = await request.body(); request._body = body 然后后续使用 request._body
   ```
2. **** (95% success)
   ```
   确保只调用一次 await request.json() 或 body()
   ```

## Dead Ends

- **** — 流已被读取，第二次调用会报错。 (100% fail)
- **** — 会导致并发问题。 (80% fail)
