# RuntimeError: Stream consumed

- **ID:** `python/starlette-request-body-consume-error`
- **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. **** (95% success)
   ```
   在第一次读取后缓存 body，如 request._body = await request.body()
   ```
2. **** (90% success)
   ```
   使用中间件一次性读取并将 body 存入 request.state
   ```
3. **** (85% success)
   ```
   使用 ASGI 的 receive 包装器缓存请求体
   ```

## Dead Ends

- **** — 应用再次读取会报错。 (80% fail)
- **** — 第二次调用会引发 RuntimeError。 (90% fail)
- **** — 不符合 ASGI 规范。 (70% fail)
