不支持 wget http 方法

发布于 2024-12-11 00:47:35 字数 1067 浏览 0 评论 0原文

我正在尝试使用 wget 从命令行访问名为“WiFi photo”的 iPad 应用程序中的 http 服务器。它可以与curl 和firefox 配合使用,但我在wget 中收到错误505。

我该如何修复这个错误?

我尝试过的命令输出

wget 给出的错误

mac:getphotos billy$ wget 10.0.2.34:15555
--2011-10-19 10:53:05--  http://10.0.2.34:15555/
Connecting to 10.0.2.34:15555... connected.
HTTP request sent, awaiting response... 505 HTTP Version not supported
2011-10-19 10:53:05 ERROR 505: HTTP Version not supported.

mac:getphotos billy$

Firefox 中成功请求的响应标头

响应标头

Content-Length  2136
Date    Wed, 19 Oct 2011 07:58:33 GMT
Accept-Ranges   bytes
Content-Type    text/html;charset=UTF-8

请求标头

Host    10.0.2.34:15555
User-Agent  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20100101 Firefox/6.0.2
Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-gb,en;q=0.7,am;q=0.3
Accept-Encoding gzip, deflate
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection  keep-alive
Cache-Control   max-age=0

I am trying to access the http server in an iPad app called "WiFi photo" from the command line using wget. It works with curl, and through firefox, but I am getting error 505 in wget.

How can I fix this error?

Output of commands I have tried

Error given by wget

mac:getphotos billy$ wget 10.0.2.34:15555
--2011-10-19 10:53:05--  http://10.0.2.34:15555/
Connecting to 10.0.2.34:15555... connected.
HTTP request sent, awaiting response... 505 HTTP Version not supported
2011-10-19 10:53:05 ERROR 505: HTTP Version not supported.

mac:getphotos billy$

Response headers from successful request in Firefox

Response Headers

Content-Length  2136
Date    Wed, 19 Oct 2011 07:58:33 GMT
Accept-Ranges   bytes
Content-Type    text/html;charset=UTF-8

Request Headers

Host    10.0.2.34:15555
User-Agent  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20100101 Firefox/6.0.2
Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-gb,en;q=0.7,am;q=0.3
Accept-Encoding gzip, deflate
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection  keep-alive
Cache-Control   max-age=0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

季末如歌 2024-12-18 00:47:35

wget 仅支持 HTTP/1.0。请参阅文档,Wget 理解 HTTP/1 吗?< /a>:

Wget 是一个 HTTP/1.0 客户端。但是,由于 HTTP/1.1 协议旨在完全支持 HTTP/1.0 客户端,因此 Wget 可以与大多数 HTTP/1.1 服务器进行互操作。

当 Wget 发送 HTTP 1.0 请求时,HTTP 服务器似乎拒绝通信(我非常确定这违反了规范)。考虑向应用程序的开发人员提交错误。否则,您需要使用其他支持 HTTP/1.1 的东西,例如 curl

wget only supports HTTP/1.0. See the documentation, Does Wget understand HTTP/1.?:

Wget is an HTTP/1.0 client. But, since the HTTP/1.1 protocol was designed to fully support HTTP/1.0 clients, Wget interoperates with most HTTP/1.1 servers.

It appears that the HTTP server is refusing to communicate when Wget sends an HTTP 1.0 request (which I'm pretty sure violates the spec). Consider filing a bug with the developer of the app. Otherwise you'll need to use something else like curl that supports HTTP/1.1.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文