[Twisted-Python] Compress/deflate support for getPage...
Is there any support for compress/deflate for webpages using the web client via getPage? If not, does anyone have a wrapper function before I make my own? Thanks
Along similar lines, is there a better API than getPage() that allows you to get headers, content-type, etc? The below could be easiliy implemented as a callback if the callback knew what headers it got, so it knew whether or not to deflate the body. Alec On Dec 8, 2008, at 4:00 PM, Sam's Lists wrote:
Is there any support for compress/deflate for webpages using the web client via getPage?
If not, does anyone have a wrapper function before I make my own?
Thanks
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
For a recent project I directly used HTTPClientFactory, the factory
that getPage is based on. That required a bit more effort than a
simple getPage(...).addCallback(func) but it wasn't terrible.
-Aaron
On Mon, Dec 8, 2008 at 4:47 PM, Alec Flett
Along similar lines, is there a better API than getPage() that allows you to get headers, content-type, etc? The below could be easiliy implemented as a callback if the callback knew what headers it got, so it knew whether or not to deflate the body.
Alec
On Dec 8, 2008, at 4:00 PM, Sam's Lists wrote:
Is there any support for compress/deflate for webpages using the web client via getPage?
If not, does anyone have a wrapper function before I make my own?
Thanks
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
getPage has a number of deficiencies. JP Calderone and Itamar Shtull- Trauring have been working on this ticket: http://twistedmatrix.com/trac/ticket/886 which (among other things) adds support for response headers and the hooks with which one would implement deflate support. On 12:47 am, alecf@metaweb.com wrote:
Along similar lines, is there a better API than getPage() that allows you to get headers, content-type, etc? The below could be easiliy implemented as a callback if the callback knew what headers it got, so it knew whether or not to deflate the body.
Alec
On Dec 8, 2008, at 4:00 PM, Sam's Lists wrote:
Is there any support for compress/deflate for webpages using the web client via getPage?
If not, does anyone have a wrapper function before I make my own?
Thanks
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
I've checked out the expressive http version of the code mentioned in the
ticket, but I still can't seem to figure out how to get access to the
response headers.
Aaron..do you have an example of how you used HTTPClientFactory?
Any suggestions about the best way to implement this using either the
official twisted branch or the expressive client branch would be helpful.
I've implemented similar functionality in the past around urllib2, but my
experience with Twisted is very limited.
I've been looking at the code for the past two hours. I just can't figure
it out. :(
Thanks!
On Mon, Dec 8, 2008 at 8:34 PM,
getPage has a number of deficiencies. JP Calderone and Itamar Shtull- Trauring have been working on this ticket: < http://twistedmatrix.com/trac/ticket/886> which (among other things) adds support for response headers and the hooks with which one would implement deflate support.
On 12:47 am, alecf@metaweb.com wrote:
Along similar lines, is there a better API than getPage() that allows you to get headers, content-type, etc? The below could be easiliy implemented as a callback if the callback knew what headers it got, so it knew whether or not to deflate the body.
Alec
On Dec 8, 2008, at 4:00 PM, Sam's Lists wrote:
Is there any support for compress/deflate for webpages using the web client via getPage?
If not, does anyone have a wrapper function before I make my own?
Thanks
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (4)
-
Aaron DeVore
-
Alec Flett
-
glyph@divmod.com
-
Sam's Lists