{
  "id": "python/flask-json-decode-bad-request",
  "signature": "werkzeug.exceptions.BadRequest: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.",
  "signature_zh": "werkzeug.exceptions.BadRequest: 400 错误请求：浏览器（或代理）发送了服务器无法理解的请求。",
  "regex": "werkzeug\\.exceptions\\.BadRequest:\\ 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.get_json()` was called on a request without `Content-Type: application/json` or with malformed JSON.",
  "root_cause_type": "generic",
  "root_cause_zh": "在缺少 `Content-Type: application/json` 或 JSON 格式错误的请求上调用 `request.get_json()`。",
  "versions": [
    {
      "version": "2.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Output formatting config, not input parsing.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Silently accepts malformed input, masks client bugs.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.93,
      "how": "data = request.get_json(silent=True) or {}\nif not data:\n    return jsonify(error='invalid json'), 400",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "requests.post(url, json={'k': 'v'})  # sets application/json automatically",
      "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-04-16",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}