{
  "id": "api/rest-api-version-header-missing-accept",
  "signature": "406 Not Acceptable: API version specified in Accept header is not supported",
  "signature_zh": "406 不可接受：Accept 头中指定的 API 版本不受支持",
  "regex": "406 Not Acceptable.*API version|Accept header.*version.*not supported",
  "domain": "api",
  "category": "version_error",
  "subcategory": null,
  "root_cause": "Client sent an Accept header with a media type that includes an API version (e.g., application/vnd.myapp.v2+json) that the server does not recognize or does not serve.",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端发送的 Accept 头包含的媒体类型中指定了服务器无法识别或不提供的 API 版本（例如 application/vnd.myapp.v2+json）。",
  "versions": [
    {
      "version": "REST API versioning via Accept header",
      "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"
    },
    {
      "version": "Spring MVC 6.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Express.js 4.18",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Without the Accept header, the server may default to the latest version or return a generic response, but this defeats version negotiation and may cause unexpected behavior.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The server may interpret application/json as the latest version, but if the client specifically needs an older version, this will not work and may break backward compatibility.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Verify the exact version string the server supports by checking the API documentation or querying a version discovery endpoint. Use the correct media type, e.g., application/vnd.myapp.v1+json for version 1.",
      "success_rate": 0.95,
      "how": "Verify the exact version string the server supports by checking the API documentation or querying a version discovery endpoint. Use the correct media type, e.g., application/vnd.myapp.v1+json for version 1.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the API uses a URL-based versioning scheme (e.g., /api/v1/), switch to that instead of Accept header versioning. Many APIs support both methods.",
      "success_rate": 0.85,
      "how": "If the API uses a URL-based versioning scheme (e.g., /api/v1/), switch to that instead of Accept header versioning. Many APIs support both methods.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "通过查看 API 文档或查询版本发现端点，验证服务器支持的确切版本字符串。使用正确的媒体类型，例如 v1 版本使用 application/vnd.myapp.v1+json。",
    "如果 API 使用基于 URL 的版本控制方案（例如 /api/v1/），则切换为使用该方案而不是 Accept 头版本控制。许多 API 同时支持这两种方法。"
  ],
  "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": "406",
  "verification_tier": "ai_generated",
  "confidence": 0.89,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-09-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}