# fastapi.exceptions.RequestValidationError: Header 'Authorization' is required

- **ID:** `python/fastapi-header-missing`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

请求中缺少路径操作函数声明的必需HTTP头部

## Version Compatibility

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

## Workarounds

1. **在请求中包含必需头部** (95% success)
   ```
   Authorization: Bearer token123
   ```
2. **在Header参数中设置默认值** (90% success)
   ```
   from fastapi import Header
async def endpoint(authorization: str = Header(None)):
   ```

## Dead Ends

- **在路由函数中使用默认值** — Header验证在函数执行前进行 (60% fail)
- **修改Header为可选但保留逻辑** — 可选后不会报错但逻辑可能不完整 (40% fail)
