{
  "id": "python/starlette-request-body-parsing",
  "signature": "json.JSONDecodeError: Expecting value: line 1 column 1 (char 0)",
  "signature_zh": "JSON 解码错误：期望值：第 1 行第 1 列（字符 0）。",
  "regex": "json\\.JSONDecodeError:\\ Expecting\\ value:\\ line\\ 1\\ column\\ 1\\ \\(char\\ 0\\)",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Request body is empty or not valid JSON when trying to parse with request.json().",
  "root_cause_type": "generic",
  "root_cause_zh": "请求体为空或不是有效的 JSON，但尝试用 request.json() 解析。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Works but masks the root cause; better to validate request content type.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "body() returns bytes; need to decode and json.loads.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Check content-type first: if request.headers.get('content-type') == 'application/json':\n    data = await request.json()\nelse:\n    return JSONResponse(status_code=415)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Use a middleware to parse JSON and handle errors gracefully.",
      "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-04-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}