# HTTPException: 405 Method Not Allowed: POST /items

- **ID:** `python/starlette-http-method-not-allowed`
- **Domain:** python
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Starlette 应用的路由未定义请求的 HTTP 方法

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.10 | active | — | — |
| 3.11 | active | — | — |

## Workarounds

1. **为路由添加方法支持** (95% success)
   ```
   from starlette.routing import Route
routes = [Route('/items', endpoint=ItemsEndpoint, methods=['GET', 'POST'])]
   ```
2. **使用正确的 HTTP 方法请求** (90% success)
   ```
   GET /items  # 如果只定义了 GET
   ```

## Dead Ends

- **在客户端更改方法但不通知服务器** — 服务器仍然不允许 (90% fail)
- **删除路由并重新添加** — 可能未添加正确的方法 (60% fail)
