I am not sure if 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 so, how could one create a non-blocking asynchronous HTTP request in python?
Thanks from python noob.
source
share