Does python's httplib.HTTPConnection block?

Posted by python_noob on Stack Overflow See other posts from Stack Overflow or by python_noob
Published on 2010-04-05T01:30:06Z Indexed on 2010/04/05 1:33 UTC
Read the original article Hit count: 433

Filed under:

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.

© Stack Overflow or respective owner

Related posts about python