Documentation states that ‘handleResponseEnd’ is called when the response has been completely received.
http://twistedmatrix.com/documents/11.0.0/api/twisted.web.http.HTTPClient.html#handleResponseEnd
However, debugging appears to show that is not always true. When making multiple requests to the same URI, it appears to only get called for the FIRST request. When making multiple requests to different URIs, it still only appears to be called for the FIRST request.
Is this behavior desired? Making requests to the same URI multiple times almost makes sense, since the response received is generally “304 Not Modified”, so the client does not receive the content multiple times. However, I would still expect for a callback to run stating “we are done receiving the response”.
Is there a different callback that would be more suitable to access the full response from?
Usually you’d instantiate a new
HTTPClientfor each request by callingbuildProtocol()on your factory. This is whatHTTPPageGetterandAgentdo.One exception to this is when using HTTP persistent connections.
What are you doing such that you need to use the same protocol instance for multiple requests?