gpt4 book ai didi

http - HTTP 状态码 300(多项选择)的确切响应结构是什么?

转载 作者:可可西里 更新时间:2023-11-01 15:10:32 25 4
gpt4 key购买 nike

当用户点击我网站上的绘图链接 http://mysite.com/some-drawing 时,我希望我的服务器响应状态代码 300 和两个资源位置:http://mysite.com/some-drawing.pnghttp://mysite.com/some- drawing.myapp,并让客户端浏览器根据其功能自动决定使用哪个:

  • 如果用户的机器上安装了 MyApp,那么浏览器应该下载 *.myapp 版本并使用 MyApp 来显示它。

  • 但是,如果没有安装 MyApp,并且浏览器无法显示这个版本,那么我希望它选择 *.png 版本。

但是,我很难弄清楚状态代码为 300 的 HTTP 响应的结构。

rfc2616说:

The requested resource corresponds to any one of a set of representations, each with its own specific location, and agent- driven negotiation information (section 12) is being provided so that the user (or user agent) can select a preferred representation and redirect its request to that location.

Unless it was a HEAD request, the response SHOULD include an entity containing a list of resource characteristics and location(s) from which the user or user agent can choose the one most appropriate. The entity format is specified by the media type given in the Content- Type header field. Depending upon the format and the capabilities of the user agent, selection of the most appropriate choice MAY be performed automatically. However, this specification does not define any standard for such automatic selection.

If the server has a preferred choice of representation, it SHOULD include the specific URI for that representation in the Location field; user agents MAY use the Location field value for automatic redirection. This response is cacheable unless indicated otherwise.

包含资源特征和位置列表的实体”这一措辞似乎含糊不清。这是什么意思?有人知道这是怎么做到的吗?

最佳答案

那行不通。

“多项选择”是通过发送超文本 (HTML) 内容中的链接并让用户选择来完成的。

关于http - HTTP 状态码 300(多项选择)的确切响应结构是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8905545/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com