{
  "id": "python/starlette-http-exception-405-method-not-allowed",
  "signature": "starlette.exceptions.HTTPException: 405: Method Not Allowed",
  "signature_zh": "starlette.exceptions.HTTPException: 405: 方法不允许",
  "regex": "starlette\\.exceptions\\.HTTPException:\\ 405:\\ Method\\ Not\\ Allowed",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The HTTP method used (e.g., POST) is not allowed for the requested endpoint.",
  "root_cause_type": "generic",
  "root_cause_zh": "使用的 HTTP 方法（例如 POST）不允许用于请求的端点。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Assuming all methods are allowed by default",
      "why_fails": "Starlette requires explicit method registration.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using GET when POST is required",
      "why_fails": "Method mismatch leads to 405.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Define route with correct methods",
      "success_rate": 0.9,
      "how": "from starlette.routing import Route\nasync def handle(request):\n    return PlainTextResponse('OK')\napp.add_route('/data', handle, methods=['POST'])",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use method-specific decorators",
      "success_rate": 0.95,
      "how": "@app.post('/data')\nasync def create(request):\n    return JSONResponse({'status': 'created'})",
      "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.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-06-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}