2

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
Billy Moon
  • 57,113
  • 24
  • 136
  • 237

1 Answers1

1

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.

Mechanical snail
  • 29,755
  • 14
  • 88
  • 113
  • 1
    Since [v1.13](https://en.wikipedia.org/wiki/Wget#Notable_releases) in 2011 wget supports HTTP/1.1 [(via)](https://stackoverflow.com/a/2073821) and has switched to it as default somewhere on the way to 2022 when this comment was written. – cachius Apr 22 '22 at 17:36