edit: This answer works, but nowadays you should just use the requests library as mentioned by other answers below.
>>> import httplib
>>> conn = httplib.HTTPConnection("www.google.com")
>>> conn.request("HEAD", "/index.html")
>>> res = conn.getresponse()
>>> print res.status, res.reason
>>> print res.getheaders()
[('content-length', '0'), ('expires', '-1'), ('server', 'gws'), ('cache-control', 'private, max-age=0'), ('date', 'Sat, 20 Sep 2008 06:43:36 GMT'), ('content-type', 'text/html; charset=ISO-8859-1')]
There's also a getheader(name) to get a specific header.
this response marked as answered but one should look at the requests lib. Look at the Dalius's response that is a bit below.
This is really nice, but it requires you to have separate values for the host and path of the request. It's useful to have urlparse at hand, which is shown by some lower-ranked reponse.
Unfortunately, requests isn't shipped with Python by default.