{
  "id": "python/flask-bad-request-key-error",
  "signature": "werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.",
  "signature_zh": "Werkzeug 异常：400 错误请求：浏览器（或代理）发送了服务器无法理解的请求。",
  "regex": "werkzeug\\.exceptions\\.BadRequestKeyError:\\ 400\\ Bad\\ Request:\\ The\\ browser\\ \\(or\\ proxy\\)\\ sent\\ a\\ request\\ that\\ this\\ server\\ could\\ not\\ understand\\.",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "访问 request.form 或 request.args 中不存在的键，且未设置默认值，Flask 抛出 BadRequestKeyError。",
  "root_cause_type": "generic",
  "root_cause_zh": "访问 request.form 或 request.args 中不存在的键，且未设置默认值，Flask 抛出 BadRequestKeyError。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "BadRequestKeyError 是 KeyError 的子类，但捕获后需手动处理，且容易忽略其他错误。",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "直接索引访问仍然会抛出相同错误。",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "value = request.form.get('key', 'default')",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "data = request.get_json(silent=True) or {}\nvalue = data.get('key', 'default')",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-10-03",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}