Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I thought head syntax was just like GET syntax but when I tried with telnet

o 80
GET /ubuntu-releases/lucid/ubuntu-10.04-desktop-i386.iso

it works as expect whereas

o 80
HEAD /ubuntu-releases/lucid/ubuntu-10.04-desktop-i386.iso

failed. So what would be the telnet syntax for HEAD request ?

share|improve this question
up vote 4 down vote accepted

You need to specify the HTTP/1.1 protocol has well as Host header

o 80
HEAD /ubuntu-releases/lucid/ubuntu-10.04-desktop-i386.iso HTTP/1.1

HTTP/1.1 200 OK
Date: Tue, 22 Jun 2010 20:59:19 GMT
Server: Apache/2.2.9 (Debian)
Last-Modified: Thu, 29 Apr 2010 12:56:31 GMT
ETag: "238046-2bb71800-4855fa7d53dc0"
Accept-Ranges: bytes
Content-Length: 733419520
Content-Type: application/x-iso9660-image
share|improve this answer
Thank you so much couldn't find example anywhere on the whole internet ! – asksuperuser Jun 22 '10 at 22:29
fyi: If the protocol version is not specified, HTTP 0.9 is assumed (because it did not have the headers or the version tag). – grawity Jun 23 '10 at 20:08
@grawity good remark, another one is that HEAD /ubuntu-releases/lucid/ubuntu-10.04-desktop-i386.iso HTTP/1.0 without the Host header also works – radius Jun 23 '10 at 23:29

You must log in to answer this question.