requests, httpx, aiohttp……
python 的 http 工具其实挺多,但有时候不好取舍。就写了这个统一的工具,backend 支持 httpx 和 aiohttp ,支持了流式/非流式,同步/异步,以及各种 HTTP 方法。
地址:
1
est 7 天前
httpx 就支持 流/非流、同步/异步 了吧?
|
2
evilrabbit OP @est 嗯是的,不过 aiohttp 异步性能比较好,我们有时候是偏向于在 server 里使用 aiohttp 的。
|
3
est 7 天前
@evilrabbit 哦?性能更好有这个说法吗?有 benchmark 之类的不
|
4
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/) |
5
evilrabbit OP @est 总之就是什么都想要,就想把它们合并😆
|
6
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)
|