gpt4 book ai didi

ubuntu - HTTP 响应代码 403,但原因是 "OK"

转载 作者:行者123 更新时间:2023-12-04 18:59:33 24 4
gpt4 key购买 nike

我正在尝试使用 wget 下载文件。
我的命令如下所示:

wget https://example.com/feeder/example.xml
这是控制台中的输出:
德语:
--2020-12-12 18:07:47--  https://example.com/feeder/example.xml
Auflösen des Hostnamens example.com (example.com) … 100.100.100.100 (Some ip)
Verbindungsaufbau zu example.com (example.com)|100.100.100.100|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 403 OK
2020-12-12 18:07:47 FEHLER 403: OK.
英语:
--2020-12-12 18:07:47-- https://example.com/feeder/example.xml
Resolving the hostname example.com (example.com) ... 100.100.100.100 (Some ip)
Connecting to example.com (example.com)|100.100.100|:443 ... connected.
HTTP request sent, waiting for response ... 403 OK
2020-12-12 18:07:47 ERROR 403: OK.
如果响应代码是 403,我会期待像“禁止”这样的错误,但我会得到“确定”。

最佳答案

来自 the spec

6.1.1 Status Code and Reason Phrase


The Status-Code element is a 3-digit integer result code of the attempt to understand and satisfy the request. These codes are fully defined in section 10. The Reason-Phrase is intended to give a short textual description of the Status-Code. The Status-Code is intended for use by automata and the Reason-Phrase is intended for the human user. The client is not required to examine or display the Reason- Phrase.


最后一句话最能说明问题;完全不应该依赖于原因短语的准确性/拼写/语言/文本(程序化和人类推理)。鉴于服务器可以被编码为发送任何东西,它发送 OK 表示服务器中的一个错误,但不是一个有问题的错误(在“你接受的自由”意义上) - 你应该忽略它,或者报告它作为服务器代码维护者的错误,如果您能够确定它是什么服务器并且它是当前的未知问题

关于ubuntu - HTTP 响应代码 403,但原因是 "OK",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65267712/

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