Does python's httplib.HTTPConnection block?
- by python_noob
Hello, I am unsure whether or not the following code is a blocking operation in python:
import httplib
import urllib
def do_request(server, port, timeout, remote_url):
conn = httplib.HTTPConnection(server, port, timeout=timeout)
conn.request("POST", remote_url, urllib.urlencode(query_dictionary, True))
conn.close()
return True
do_request("http://www.example.org", 80, 30, "foo/bar")
print "hi!"
And if it is, how would one go about creating a non-blocking asynchronous http request in python?
Thanks from a python noob.