Remix.run Logo
KaiserPro a day ago

Why would you want to use HTTPX2 over say requests?

JimDabell 8 hours ago | parent | next [-]

Requests 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/

KaiserPro 3 hours ago | parent [-]

Aha, this is the context I was missing

thanks!

12_throw_away 21 hours ago | parent | prev | next [-]

Async. 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-trans...

deathanatos 19 hours ago | parent | prev | next [-]

Since it clearly intends to satisfy the async use case, I wish you'd've phrased this as "over aiohttp".

a day ago | parent | prev | next [-]
[deleted]
imp0cat a day ago | parent | prev | next [-]

You probably want to use pretty much anything over requests for performance reasons.

oersted a day ago | parent | prev [-]

async