[Twisted-web] How can I change the HTTP request to avoid gzip

Radu Dragusin radudragusin at gmail.com
Tue Dec 16 09:54:17 EST 2008


I deleted the 'accept-encoding' key as you said and it worked. No more gzip.

Thread solved.
Thank you!


> Request has a received_headers attribute which refers to a dictionary.  Y=
ou
> can delete the "accept" key from it.  Make sure you do it before you call
> the base process method, though:
>
>   def process(self):
>       try:
>           del self.received_headers['accept']
>       except KeyError:
>           pass
>       proxy.ProxyRequest.process(self)
>
> Or, in Twisted 8.2, you can use a slightly better headers API:
>
>   def process(self):
>       self.requestHeaders.removeHeader('accept')
>       proxy.ProxyRequest.process(self)
>
> Jean-Paul
>
> _______________________________________________
> Twisted-web mailing list
> Twisted-web at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
>


-- =

Radu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-web/attachments/20081216/31=
e67f65/attachment.htm


More information about the Twisted-web mailing list