{
  "id": "python/starlette-http-method-not-allowed",
  "signature": "HTTPException: 405 Method Not Allowed: POST /items",
  "signature_zh": "HTTP 异常：405 方法不允许：POST /items",
  "regex": "HTTPException:\\ 405\\ Method\\ Not\\ Allowed:\\ POST\\ /items",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "Starlette 应用的路由未定义请求的 HTTP 方法",
  "root_cause_type": "generic",
  "root_cause_zh": "Starlette 应用的路由未定义请求的 HTTP 方法",
  "versions": [
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "在客户端更改方法但不通知服务器",
      "why_fails": "服务器仍然不允许",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "删除路由并重新添加",
      "why_fails": "可能未添加正确的方法",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "为路由添加方法支持",
      "success_rate": 0.95,
      "how": "from starlette.routing import Route\nroutes = [Route('/items', endpoint=ItemsEndpoint, methods=['GET', 'POST'])]",
      "condition": "",
      "sources": []
    },
    {
      "action": "使用正确的 HTTP 方法请求",
      "success_rate": 0.9,
      "how": "GET /items  # 如果只定义了 GET",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-09-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}