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:
# In the future, having the protocol version be a parameter to this
# method would probably be good. It would be nice if this method
# weren't limited to issueing HTTP/1.1 requests.
requestLines = []
requestLines.append(
'%s %s HTTP/1.1\r\n' % (self.method, self.uri))
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:
HTTPPageGetter
HTTPPageDownloader
HTTPClientFactory
HTTPDownloader
getPage
downloadPage
But if you stray from those, I think you’ll end up using the new HTTP 1.1-only (for now) implementation.