{
  "id": "python/flask-json-415-unsupported-media-type",
  "signature": "werkzeug.exceptions.UnsupportedMediaType: 415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.",
  "signature_zh": "werkzeug.exceptions.UnsupportedMediaType: 415 不支持的媒体类型：请求 Content-Type 不是 'application/json'，未尝试加载 JSON 数据。",
  "regex": "werkzeug\\.exceptions\\.UnsupportedMediaType:\\ 415\\ Unsupported\\ Media\\ Type:\\ Did\\ not\\ attempt\\ to\\ load\\ JSON\\ data\\ because\\ the\\ request\\ Content\\-Type\\ was\\ not\\ 'application/json'\\.",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "request.get_json() called but the client sent no Content-Type: application/json header (common with curl or fetch defaults).",
  "root_cause_type": "generic",
  "root_cause_zh": "调用了 request.get_json()，但客户端未发送 Content-Type: application/json 头（常见于 curl 或 fetch 默认行为）。",
  "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": "Hides the contract bug and can produce confusing 400s on malformed bodies.",
      "fail_rate": 0.55,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Returns wrong status; client still gets no data.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "curl -X POST -H 'Content-Type: application/json' -d '{\"a\":1}' http://localhost:5000/api",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "data = request.get_json(silent=True) or {}  # explicit fallback for non-JSON",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-09-03",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}