Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

o mirror.bytemark.co.uk 80
GET /ubuntu-releases/lucid/ubuntu-10.04-desktop-i386.iso

it works as expect whereas

o mirror.bytemark.co.uk 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

1 Answer 1

up vote 4 down vote accepted

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

o mirror.bytemark.co.uk 80
HEAD /ubuntu-releases/lucid/ubuntu-10.04-desktop-i386.iso HTTP/1.1
Host: mirror.bytemark.co.uk

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
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.