If I am issuing an HTTP request using twisted.web.client.Agent how do I force the request to use HTTP 1.0? By default HTTP 1.1 is used.
Edit: The reason why I am interested in using HTTP 1.0 is because I wish to disable Chunked Transfer Encoding, and the most reliable way of doing this is by using HTTP 1.0.
If you want to use
twisted.web.client.Agent, you can’t without monkeypatching or something. Tracing through the source, one of the things you’ll find is:So it’s hardcoded. You might be able to get around that with some monkeypatching, but it’s not terribly easy.
But that doesn’t mean you’re out of luck; that applies only to
twisted.web.client.Agent. If you can move away from using that class, it appears some old HTTP 1.0-only code is still around. In particular, if you use these classes/functions, it looks like you’ll be using HTTP 1.0:HTTPPageGetterHTTPPageDownloaderHTTPClientFactoryHTTPDownloadergetPagedownloadPageBut if you stray from those, I think you’ll end up using the new HTTP 1.1-only (for now) implementation.