On 08:09 pm, firstname.lastname@example.org wrote:
On Oct 10, 2009, at 7:34 AM, Reza Lotun wrote:
I'm not quite sure what you mean. Are you talking about web.client or
Web client. I was having trouble with a particular URL which happened to be a download URL and wanted to see what the request and response objects looked like and was trying to find where I could examine them. In the code I posted before, we were creating an HTTPClientFactory, then snagging the deferred. I've simplified that by just using client.getPage(). The advantage of the HTTPClientFactory approach is that you can get at the response_headers.
There is a new twisted.web client implementation in the works which will hopefully be ready for trunk in the near future, and which should provide nearly the same functionality offered by urllib2 (or more).
Where might that be hiding? I'd love to have something that does deferreds like Twisted and also implements all of urllib2. I find the info() from urlopen() particularly helpful when debugging issues like this.
As I understand the "info" method, it gives you access to the response headers. The new API definitely exposes that information.
You'll notice that neither of these tickets is closed. #3987 is presently up for review. If you want to help out, you could take a look at the code and point out any problems you notice.