HTTPX2 – A next-generation HTTP client for Python
github.com
github.com
From my perspective, HTTP requests have been mastered for years (decades?). What's the point of switching libraries? What's so extraordinary about the new HTTP library that makes requests look crap?
I understand that new protocols appear from time to time (like HTTP/2), but that's very rare. And if there are performance differences between two libraries, are they really that huge? Even if they are, 99% of people don't need that boost. What prevents someone from just improving the existing library's performance?
`aiohttp` supports `async` but was never popular for non-async
`httpx` supported newer HTTP versions and both async and non-async. However the maintainer decided to close all outside submissions, issues and discussions for personal reasons.
`httpx2` is a maintained fork of `httpx`
- Non-portability to alternative Python implementations or environments without the supporting C libraries
- Less visibility into the client internals (for debugging etc)
Of course, it is clearly superior to everything else (being authored by a french guy !). But sadly, some people do not accept this simple fact :(
>`httpx` supported newer HTTP versions and both async and non-async. However the maintainer decided to close all outside submissions, issues and discussions for personal reasons.
how can something like this happen? and which positive consequence there can be out of that?
Specifically in this case, the consensus seems to be the maintainer is having some mental health struggles and chose to close out outside contribution.
only problem I have and that's probably why I didn't associate it directly myself is that I see the example very valid for many other FOSS cases.
but in this case it feels like the part at the bottom is made of multiple random persons, not a single one, and one of those random persons decided to exclude all the other random persons.
so maybe the lower layer shall be represented as made of multiple pieces that fight each other, beside the all modern shit on top of it.
- (a) built-ins (& some libraries) being very verbose to use because they tend to take a "fundamentals of HTTP" approach & not implement shortcuts/common patterns
- (b) libraries commonly falling into the trap of going the opposite direction & ending up with massive scope-creep and/or oversimplified, un-expressive APIs.
This leads to a churn of libraries due to developers yearning for a Goldilocks implementation in between.
Javascript tends to be ahead of other ecosystems in churn due to ease of library publishing, Python's catching up, but overall it's the same pattern in both.
---
Also, one big additional factor is async:
- NodeJS built-ins implemented a callback pattern just before promises took off, & have struggled to upgrade to promises cleanly without breaking backward compat.
- Python's got a similar story with various generations of http library being sync, or relying on different async approaches in confusing ways.
(FWIW I agree w/ your objection to the "httpx2" name.)
HTTP/2 is full of growing pains and fiddly kernel config for it to perform better than even HTTP/1.1.
Moving these dependencies into userland was the path that HTTP/3 took and it has proven itself through CDN and browser adoption for years now.
I’d go as far as to say that we need to reevaluate the event loops in nginx and elsewhere to assume UDP and HTTP/3 framing instead of TCP. There are gains to be had.
The h3 juice is worth the squeeze. 0rtt TLS, BBR, HPACK, etc. You can roughly achieve this with a carefully configured h2 deployment across multiple layers and packages or just move to h3 and let the app layer handle it all. We baked all of the best practices into h3, the world just needs to move on.
HTTP/1.x is not obsolete. It fills a very relevant request structure that most of the Internet still runs on.
It's been a pleasure to use, has a httpx compatibility layer, and it's fast (https://github.com/MarkusSintonen/pyreqwest/blob/main/docs/b...)
“OpenAI: Migrating to HTTPX2” (github.com/openai)
66 points | 1 hour ago | 50 comments
Nevertheless, I'm curious about the pros and cons when comparing with "niquests".