xhttpy: 统一的 http api 请求工具,支持流/非流、同步/异步

查看 64|回复 6
作者:evilrabbit   
requests, httpx, aiohttp……
python 的 http 工具其实挺多,但有时候不好取舍。就写了这个统一的工具,backend 支持 httpx 和 aiohttp ,支持了流式/非流式,同步/异步,以及各种 HTTP 方法。
地址:
https://github.com/hscspring/xhttpy

HTTP, API, Requests

est   
httpx 就支持 流/非流、同步/异步 了吧?
evilrabbit
OP
  
@est 嗯是的,不过 aiohttp 异步性能比较好,我们有时候是偏向于在 server 里使用 aiohttp 的。
est   
@evilrabbit 哦?性能更好有这个说法吗?有 benchmark 之类的不
evilrabbit
OP
  
抱歉刚刚说的不准确,应该说某些场合下好一点。
- [oxylabs/httpx-vs-requests-vs-aiohttp: See how HTTPX, Requests, and AIOHTTP libraries compare for sending network requests and find out which one may fit your case better.]( https://github.com/oxylabs/httpx-vs-requests-vs-aiohttp)
- [fastapi - Why is httpx so much worse than aiohttp when facing high concurrent requests? - Stack Overflow]( https://stackoverflow.com/questions/78516655/why-is-httpx-so-much-worse-than-aiohttp-when-facing-high-concurrent-requests)
- [httpx vs aiohttp : r/Python --- httpx vs aiohttp : r/Python]( https://www.reddit.com/r/Python/comments/ig8f3o/httpx_vs_aiohttp/)
evilrabbit
OP
  
@est 总之就是什么都想要,就想把它们合并😆
evilrabbit
OP
  
@evilrabbit 补充:[perf: Use aiohttp instead of httpx for high-concurrency external calls · Issue #752 · nexi-lab/nexus]( https://github.com/nexi-lab/nexus/issues/752)
您需要登录后才可以回帖 登录 | 立即注册

返回顶部