{
  "id": "python/aiohttp-content-type-error",
  "signature": "aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html'",
  "signature_zh": "aiohttp客户端异常：尝试用意外MIME类型解码JSON: text/html",
  "regex": "aiohttp\\.client_exceptions\\.ContentTypeError:\\ 0,\\ message='Attempt\\ to\\ decode\\ JSON\\ with\\ unexpected\\ mimetype:\\ text/html'",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Calling resp.json() on a response with a non-JSON content type.",
  "root_cause_type": "generic",
  "root_cause_zh": "在具有非JSON内容类型的响应上调用resp.json()。",
  "versions": [
    {
      "version": "3.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "It's a client-side parameter, not a server-side fix.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Works but bypasses aiohttp's built-in error handling.",
      "fail_rate": 0.2,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "if resp.content_type == 'application/json': data = await resp.json() else: text = await resp.text()",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "data = await resp.json(content_type=None)",
      "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": "2025-05-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}