{
  "id": "api/http-406-not-acceptable-content-negotiation",
  "signature": "406 Not Acceptable: requested media type not supported by server",
  "signature_zh": "406 不可接受：请求的媒体类型不受服务器支持",
  "regex": "406\\s*(?:Not\\s*Acceptable)?[\\s\\S]*media\\s*type[\\s\\S]*not\\s*supported",
  "domain": "api",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "The client's `Accept` header specifies a media type (e.g., `application/xml`) that the server cannot produce, causing content negotiation to fail.",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端的 `Accept` 头指定了服务器无法生成的媒体类型（例如 `application/xml`），导致内容协商失败。",
  "versions": [
    {
      "version": "HTTP/1.1 (RFC 7231)",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Spring Boot 3.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "ASP.NET Core 8.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The server may still default to a supported type (e.g., `application/json`), but if the client explicitly requires a type, removing the header changes behavior and may cause other issues.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The server must explicitly support the requested type; the error is correct.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "While `*/*` may work, it bypasses content negotiation and may return an unexpected format.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Set the `Accept` header to a supported type, typically `application/json`. Example: `curl -H \"Accept: application/json\" https://api.example.com/resource`.",
      "success_rate": 0.95,
      "how": "Set the `Accept` header to a supported type, typically `application/json`. Example: `curl -H \"Accept: application/json\" https://api.example.com/resource`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check the server's API documentation for supported media types and update the client accordingly. Example: `GET /api/v1/resource` with `Accept: application/vnd.api+json`.",
      "success_rate": 0.9,
      "how": "Check the server's API documentation for supported media types and update the client accordingly. Example: `GET /api/v1/resource` with `Accept: application/vnd.api+json`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If you control the server, add support for the requested media type by configuring a content negotiation serializer (e.g., in Spring Boot, add `jackson-dataformat-xml` dependency).",
      "success_rate": 0.85,
      "how": "If you control the server, add support for the requested media type by configuring a content negotiation serializer (e.g., in Spring Boot, add `jackson-dataformat-xml` dependency).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "将 `Accept` 头设置为受支持的类型，通常是 `application/json`。示例：`curl -H \"Accept: application/json\" https://api.example.com/resource`。",
    "查看服务器 API 文档以了解支持的媒体类型，并相应更新客户端。示例：`GET /api/v1/resource` 使用 `Accept: application/vnd.api+json`。",
    "如果您控制服务器，通过配置内容协商序列化器（例如，在 Spring Boot 中添加 `jackson-dataformat-xml` 依赖）来添加对请求媒体类型的支持。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/406",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-11-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}