twisted http client

后端 未结 3 980
我在风中等你
我在风中等你 2021-02-05 13:47

I am after an example describing the usage of Twisted\'s HTTP Client.

After reading the excellent blog post on the internals of Twisted, I understand how the \"Factory\

相关标签:
3条回答
  • 2021-02-05 14:05

    I started using treq with twisted. treq has an API which is very similar to Requests. https://pypi.python.org/pypi/treq/0.2.0

    0 讨论(0)
  • 2021-02-05 14:09

    As of Twisted 9.0, there are actually two HTTP clients available. The older one has quite a few features, such as automatically following redirects, interpreting cookie headers, etc. You can find an example of its usage here:

    http://twistedmatrix.com/documents/current/web/examples/

    (getpage.py and dlpage.py)

    Unfortunately, the interface presented by the older client makes a number of common tasks difficult. For example, using getPage, you cannot examine arbitrary response headers.

    The newer HTTP client isn't yet as featureful as the old one, but it presents an interface intended to eliminate the limitations of getPage. It is also intended to be more easily extended and customized. You can find a document describing its usage here:

    http://twistedmatrix.com/documents/current/web/howto/client.html

    0 讨论(0)
  • 2021-02-05 14:19

    As of Twisted 10, you may want to use the Agent class.

    Please follow this link: http://twistedmatrix.com/documents/10.2.0/web/howto/client.html

    0 讨论(0)
提交回复
热议问题