[Twisted-Python] Newbie: Help with twisted.web, HTTPClient

Daniel Burr ldanielburr at earthlink.net
Sat Jul 27 13:11:07 EDT 2002


I just started playing with Twisted last week; great stuff!

My question is this:  I have an .rpy file, which defines a Resource.  As part
of this Resource's render method, I need to perform an http GET against
another server, which of course causes the twisted.web server to block.  From
looking through the source code, it looks like the HTTPClient should be what I
need to perform a non-blocking http GET from within my resource, but I cannot
find  any information on how to use it; just creating an instance and doing
sendCommand fails, stating that there is no transport.

I guess I could just use httplib.HTTPConnection, but I'd have to run that in a
separate thread in order to prevent blocking, and it just seems like I
shouldn't need to use threads for something so simple.

Any advice or help would be greatly appreciated, thanks.

Daniel Burr




More information about the Twisted-Python mailing list