Hacker News new | past | comments | ask | show | jobs | submit login
What is a HTTP HEAD request good for? — Some uses (mostof.it)
4 points by ochronus on Nov 8, 2010 | hide | past | favorite | 2 comments



Head can also sometimes get around restrictions in place. Some web servers place access control restrictions on GET and POST requests only, and when combined with other silliness (such as returning 200 OK or 404 errors for almost everything) then the HEAD will usually tell you what's what.

Of course sometimes it's the other way around and the HEAD request will give you 200 for everything.


Conversely, HEAD sometimes doesn't accurately reflect the headers for a resource available via GET. For example this is the case with App Engine's broken webapp framework (and every app that consumes it):

  $ curl -sD- http://appengine-cookbook.appspot.com/|head -1
  HTTP/1.1 200 OK
  $ curl -s --head http://appengine-cookbook.appspot.com/|head -1
  HTTP/1.1 405 Method Not Allowed




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: