在twisted.web代理之上构建的类似api的请求
treq的Python项目详细描述
treq
treq是一个受 requests但写在 Twisted的 Agents。
它提供了一个简单的、更高级别的api,用于在 使用扭曲的。
>>>fromtreqimportget>>>defdone(response):...printresponse.code...reactor.stop()>>>get("http://www.github.com").addCallback(done)>>>fromtwisted.internetimportreactor>>>reactor.run()200
更多信息read the docs。
开发
安装依赖项:
pip install treq[dev]
运行测试(单元和集成):
trial treq
绒布:
pep8 treq pyflakes treq
生成文档:
tox -e docs