$ pip install curequests
from curio import run
from curequests import get, post
async def main():
r = await get('https://httpbin.org/get')
print(r.json())
r = await post('https://httpbin.org/post', json={'hello': 'world'})
print(r.json())
run(main)
和 Requests 一样的味道,请参考 Requests 文档 食用!
Github: https://github.com/guyskk/curequests
1
czheo 2017-10-29 21:48:15 +08:00
Nice
|
2
hl 2017-10-29 22:29:46 +08:00
为啥不 aiohttp
|
4
EricCartman 2017-10-29 22:49:03 +08:00 via Android
果然不支持 Python 2,现在生产环境还是 Python 2 + Tornado httpclient,
相比 requests 还是蛮难用的 |
5
Kilerd 2017-10-29 22:50:30 +08:00
又是你,这个偏爱 curio 的家伙
|
6
chenqh 2017-10-29 22:51:45 +08:00 via iPhone
@EricCartman 我也是
|
9
czheo 2017-10-30 22:46:04 +08:00 1
看到 curio 的作者推了你的包。
https://twitter.com/dabeaz/status/924756107117125632 |
11
dstwhk 2017-11-08 13:50:29 +08:00
很好用的样子
|