{
  "id": "python/flask-request-data-missing",
  "signature": "BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.",
  "signature_zh": "坏请求键错误：请求无法理解",
  "regex": "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": "Accessing a form or query parameter that doesn't exist in the request without a default value, causing Flask to raise a BadRequestKeyError.",
  "root_cause_type": "generic",
  "root_cause_zh": "访问请求中不存在的表单或查询参数且未提供默认值，导致Flask抛出BadRequestKeyError。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Using `request.form['key']` raises the error if key is missing; using `.get()` is a better approach.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Catching the exception and returning a generic error doesn't provide useful feedback to the client.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 1.0,
      "how": "Use `request.form.get('key')` or `request.args.get('key')` which returns None if missing.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Provide a default value: `request.form.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.89,
  "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": []
}