{
  "id": "python/flask-method-not-allowed-error",
  "signature": "werkzeug.exceptions.MethodNotAllowed: 405 Method Not Allowed",
  "signature_zh": "Werkzeug异常：405方法不允许",
  "regex": "werkzeug\\.exceptions\\.MethodNotAllowed:\\ 405\\ Method\\ Not\\ Allowed",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The requested URL exists but does not support the HTTP method used (e.g., POST to a GET-only route).",
  "root_cause_type": "generic",
  "root_cause_zh": "请求的URL存在但不支持使用的HTTP方法（例如，对仅GET的路由使用POST）。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Catching MethodNotAllowed and redirecting to the same URL can cause infinite loops.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Changing the route to accept all methods may expose unintended functionality.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Specify allowed methods explicitly: @app.route('/submit', methods=['POST'])",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use method checking in the view: if request.method == 'POST':\\n    # handle POST\\nelse:\\n    abort(405)",
      "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": "2024-02-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}