I'm trying to retrieve HTTP HEAD information from a S3 resource using Python. Unfortunately the response always returns a 403 error. I am using code that was suggested here but unfortunately this does not work for S3 requests. Here is the code (host and key details omitted):
>>> import httplib
>>> conn = httplib.HTTPConnection("www.mybucket.us")
>>> conn.request("HEAD", "/mykey?myparamterers")
>>> res = conn.getresponse()
>>> res.status
>>> 403
The request also sends a signed expiration as part of the query string.
I have also tried using httplib2 but the HEAD REQUEST simply hangs.