gpt4 book ai didi

http - 为错误的协议(protocol)返回什么 HTTP 代码

转载 作者:可可西里 更新时间:2023-11-01 15:27:22 24 4
gpt4 key购买 nike

我想为在仅 HTTPS 域上点击 HTTP 的用户返回一个 HTTP 代码,反之亦然。哪个HTTP Code适合这个吗?

我不想重定向到正确的协议(protocol),因为它会促进错误/不安全的链接,而且我的服务器设置不允许我在域上禁用该协议(protocol)。

我在想 400、403、406 或 500。

最佳答案

它认为您正在寻找:403 Forbidden (至少我会选择这个)

The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead

关于http - 为错误的协议(protocol)返回什么 HTTP 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11677571/

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