try some basic troubleshooting. assuming the url and data string are correct. are you sure you are able to get to the server? a curl request is a terminal command and connects differntly than python API type commands, python might need extra permissions opened up by your server. if you are running Apache you would need to make sure it is allowing for scirpted headers
read this:
http://httpd.apache.org/docs/2.2/mod/mod_headers.htmlhttp://httpd.apache.org/docs/2.2/mod/mod_headers.html
also try an alternate way of connecting using other libraries like the person on this thread did: How do you send a HEAD HTTP request in Python 2?
" use httplib
import httplib
conn = httplib.HTTPConnection("www.google.com")
conn.request("HEAD", "/index.html")
res = conn.getresponse()
print res.status, res.reason
200 OK
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')]
"