3 ms·
Why would you want to use HTTPX2 over say requests?
by KaiserPro 1mo ago
Why would you want to use HTTPX2 over say requests?
- deleted 1mo ago[deleted]
- oersted 1mo agoasync
- imp0cat 1mo agoYou probably want to use pretty much anything over requests for performance reasons.
- 12_throw_away 1mo agoAsync. And it comes with WSGI and ASGI transport adapters [1], which are amazing for testing/debugging with the client and server in a single process. And I personally find the httpx API is much cleaner and more composable, but ymmv. [1] https://www.python-httpx.org/advanced/transports/#wsgi-transport https://www.python-httpx.org/advanced/transports/#wsgi-trans...
- deathanatos 1mo agoSince it clearly intends to satisfy the async use case, I wish you'd've phrased this as "over aiohttp".
- JimDabell 1mo agoRequests has been dead for over a decade. It doesn’t support HTTP/2, it doesn’t support HTTP/3, it doesn’t support async, and they ignore security vulnerabilities for months. Nobody should use requests. If you are still using it, the quickest way to get off it is to switch to niquests, which is actively developed, supports all the things I mentioned above, and API-compatible with requests - you can just do `import niquests as requests` for an instant upgrade. https://niquests.readthedocs.io/ https://niquests.readthedocs.io/
- KaiserPro 1mo agoAha, this is the context I was missing thanks!