{
  "id": "python/starlette-request-form-data-error",
  "signature": "ValueError: Invalid form data: expected bytes, got str",
  "signature_zh": "ValueError: 无效的表单数据：期望字节，得到字符串",
  "regex": "ValueError:\\ Invalid\\ form\\ data:\\ expected\\ bytes,\\ got\\ str",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The form data is not properly encoded or the request body is not parsed correctly.",
  "root_cause_type": "generic",
  "root_cause_zh": "表单数据未正确编码或请求体解析不正确。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Some fields may be binary or multi-encoded, causing errors.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This is a common mistake; the method must be awaited.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 1.0,
      "how": "Use await request.form() correctly to parse the form data.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Ensure the client sends proper content-type: application/x-www-form-urlencoded or multipart/form-data.",
      "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-12-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}