不支持 wget http 方法
我正在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
wget
仅支持 HTTP/1.0。请参阅文档,Wget 理解 HTTP/1 吗?< /a>:当 Wget 发送 HTTP 1.0 请求时,HTTP 服务器似乎拒绝通信(我非常确定这违反了规范)。考虑向应用程序的开发人员提交错误。否则,您需要使用其他支持 HTTP/1.1 的东西,例如
curl
。wget
only supports HTTP/1.0. See the documentation, Does Wget understand HTTP/1.?: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.