[Twisted-Python] Using lineReceived with HTTP requests

Andrea Soong girloncrack at yahoo.com
Sun Jun 12 18:59:47 EDT 2005

How will I know when the data for the webpage is complete?  Is handleRequestEnd supposed to be called when that happens, or is that called after *I* call request.finish()?

Jp Calderone <exarkun at divmod.com> wrote:On Sat, 11 Jun 2005 00:28:38 -0700 (PDT), Andrea Soong wrote:
>Hi all,
>First off, I'd like to say thanks to Ken Whitesell for giving me some much needed help.
>Here's my problem: I am using an HTTPClient instance to connect to a webpage, and am trying to retrieve its contents and display to the screen line by line, using the lineReceived method. This is all being done in an .rpy file. For some reason, I am only receiving the header information:

The header section of an HTTP response is line-oriented. The body section is not. HTTPClient uses both of LineReceivers modes, so for the header section, lineReceived gets called, then for the body section, rawDataReceived gets called.

If you override both of these, you should see all of the data from the server. Of course, the data passed to rawDataReceive isn't going to be broken up into lines...


Twisted-Python mailing list
Twisted-Python at twistedmatrix.com

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20050612/7ba671dd/attachment.htm 

More information about the Twisted-Python mailing list