{
  "id": "python/django-request-data-error",
  "signature": "django.http.request.RawPostDataException: You cannot access body after reading from request's data stream",
  "signature_zh": "请求数据错误：在读取请求数据流后无法访问 body",
  "regex": "django\\.http\\.request\\.RawPostDataException:\\ You\\ cannot\\ access\\ body\\ after\\ reading\\ from\\ request's\\ data\\ stream",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "多次尝试读取请求体，但请求体只能读取一次",
  "root_cause_type": "generic",
  "root_cause_zh": "Django 请求对象不允许重复读取 body 数据",
  "versions": [
    {
      "version": "3.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "4.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "尝试重新读取 request.body",
      "why_fails": "请求体流已消耗，无法再次读取",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "使用 request.POST 代替",
      "why_fails": "如果请求是 JSON，request.POST 可能为空",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "一次性读取并缓存",
      "success_rate": 0.95,
      "how": "data = request.body; 之后使用 data 变量",
      "condition": "",
      "sources": []
    },
    {
      "action": "使用中间件缓存请求体",
      "success_rate": 0.9,
      "how": "使用 django.utils.datastructures.MultiValueDictKeyError 处理",
      "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.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-06-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}