偏好基于 URL 的内容协商而非 Accept 标头
Simon Willison 独立决定不使用基于 Accept 标头的内容协商,而偏好可预测的 URL——例如使用“.json”后缀来提供 JSON。
支持这项说法
评论:我们刚刚发布了对 HTTP 最“丑陋”部分的支持——Vary
(与 Cloudflare 的功能无关,我最终决定永远不采用那种模式,因为我更喜欢能按预期返回 HTML 或 JSON 的 URL——我改为在自己的应用中添加 .json 后缀,以提供 JSON。)
原始摘录
(Independent of the Cloudflare feature I ended up deciding never to use that pattern, because I prefer having URL that predictably returns HTML or JSON - I add a .json suffix to my apps to serve JSON instead.)
分享观点验证此主张
