<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Michiel's Blog - #httpxyz</title><link href="https://tildeweb.nl/~michiel/tags/httpxyz.html" rel="alternate"/><link href="https://tildeweb.nl/~michiel/tags/httpxyz/atom.xml" rel="self"/><id>https://tildeweb.nl/~michiel/tags/httpxyz.html</id><updated>2026-05-03T22:00:00+02:00</updated><subtitle>Blog - #httpxyz</subtitle><entry><title>Talk at PyGrunn on httpxyz</title><link href="https://tildeweb.nl/~michiel/pygrunn-httpxyz.html" rel="alternate"/><published>2026-05-03T22:00:00+02:00</published><updated>2026-05-03T22:00:00+02:00</updated><author><name>Michiel W. Beijen</name></author><id>tag:tildeweb.nl,2026-05-03:/~michiel/pygrunn-httpxyz.html</id><summary type="html">I'm giving yet another talk on our new Python package httpxyz!</summary><content type="html">&lt;p&gt;On Friday 8th of May 2026 I will be giving a talk on our new fork of the
popular python package &lt;strong&gt;httpx&lt;/strong&gt; called &lt;a href="https://httpxyz.org"&gt;httpxyz&lt;/a&gt; at
&lt;a href="https://pygrunn.org"&gt;PyGrunn&lt;/a&gt;. &lt;strong&gt;PyGrunn&lt;/strong&gt; is a full day Python (&amp;ldquo;and
friends&amp;rdquo;) conference in Groningen, The Netherlands. &lt;strong&gt;httpx&lt;/strong&gt; is a top-100
Python package for sending http requests but has not had a release since end of
2024, plus, recently all issues were set to hidden and all discussions are
closed. &lt;strong&gt;httpxyz&lt;/strong&gt; is our friendly fork with lots of fixes for serious and
more niche issues. Read for more info my
&lt;a href="httpxyz.html"&gt;announcement post for httpxyz&lt;/a&gt;. I will talk about why we did the
fork and how we approach it. I&amp;rsquo;ll also delve into how to build a performant API
client in Python and technical details of HTTP.&lt;/p&gt;
&lt;p&gt;This is an expanded version of the talk I gave at
&lt;a href="pyamsterdam-httpxyz.html"&gt;PyAmsterdam&lt;/a&gt; last week, and is part of my &amp;lsquo;promotion
efforts&amp;rsquo; for &lt;a href="https://httpxyz.org"&gt;httpxyz&lt;/a&gt;. I look forward to giving my talk &amp;amp;
see you there!&lt;/p&gt;
&lt;p&gt;&lt;img alt="Me presenting at PyAmsterdam" class="small" src="images/mwb-zstandard.jpg"&gt;&lt;/p&gt;</content></entry><entry><title>httpxyz one month in</title><link href="https://tildeweb.nl/~michiel/httpxyz-one-month-in.html" rel="alternate"/><published>2026-04-27T09:00:00+02:00</published><updated>2026-04-27T09:00:00+02:00</updated><author><name>Michiel W. Beijen</name></author><id>tag:tildeweb.nl,2026-04-27:/~michiel/httpxyz-one-month-in.html</id><summary type="html">One month after forking httpxyz, where we are now and where we're going</summary><content type="html">&lt;p&gt;It has been roughly a month since we forked
&lt;a href="https://github.com/encode/httpx"&gt;httpx&lt;/a&gt; and named our package
&lt;a href="https://httpxyz.org"&gt;httpxyz&lt;/a&gt;. For the reasons why I refer you to
&lt;a href="httpxyz.html"&gt;Why I forked httpx&lt;/a&gt;. In this post I will explain where we are
now, one month &amp;lsquo;into&amp;rsquo; having created the fork.&lt;/p&gt;
&lt;p&gt;TL;DR: httpxyz has now many bug fixes and significantly better performance than
httpx, and we would encourage anyone to move to our version!&lt;/p&gt;
&lt;p&gt;&lt;img alt="httpxyz logo" src="images/httpxyz.png"&gt;&lt;/p&gt;
&lt;h2&gt;Where we are now&lt;/h2&gt;
&lt;h3&gt;Initial version of fork&lt;/h3&gt;
&lt;p&gt;Our first version of httpxyz contained just the fixes to get zstd working, and
the fixes to get the test suite running on python 3.14, some &amp;lsquo;housekeeping&amp;rsquo;
changes related to the renaming, as well as some minor and trivial fixes that
had already been merged in httpx and had not been released yet.&lt;/p&gt;
&lt;h3&gt;End of March: bugfixes, and performance improvements&lt;/h3&gt;
&lt;p&gt;Then at the end of March we did another release of httpxyz, containing a
compatibility shim that allows you to use httpxyz even with third-party
packages that import httpx themselves, as long as you import httpxyz first.
We&amp;rsquo;ve added a nice
&lt;a href="https://httpxyz.org/httpx-compatibility/"&gt;documentation page&lt;/a&gt; for this.&lt;/p&gt;
&lt;p&gt;This release also included a change that lazily imports the CLI for httpxyz,
which is typically not used in your app; in my measurements this makes httpxyz
import in &lt;em&gt;half&lt;/em&gt; the time needed by httpx. This PR has been sitting idle at the
httpx repository for over a year
&lt;a href="https://github.com/encode/httpx/pull/3547"&gt;ref&lt;/a&gt; and we&amp;rsquo;ve kindly adopted it,
thanks to &lt;a href="https://github.com/natehardison"&gt;Nate Hardison&lt;/a&gt; for providing it!&lt;/p&gt;
&lt;p&gt;And apart from that we adopted a bunch of other smaller and bigger bug fixes
and improvements in this release.&lt;/p&gt;
&lt;h3&gt;httpcorexyz!&lt;/h3&gt;
&lt;p&gt;But we realized pretty soon that there were some problems that httpx was
having, that were actually caused by the underlying &amp;lsquo;transport&amp;rsquo; which is
defined in a different module, &lt;a href="https://github.com/encode/httpcore"&gt;httpcore&lt;/a&gt;.
This module also had no release in over a year, and there were a bunch of
issues reported by users, with fixes even, that were not landing. So we ended
up also forking httpcore and created
&lt;a href="https://httpxyz.org/httpcorexyz/"&gt;httpcorexyz&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here we fixed a WHOLE bunch of performance related issues:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;anyio.Lock(fast_acquire=True)&lt;/code&gt; and &lt;code&gt;anyio.Semaphore(fast_acquire=True)&lt;/code&gt;
  to skip unnecessary event loop yields on uncontended lock acquires. Reduces
  async GET latency by ~3.3x. Reinstates encode/httpcore#953 which was reverted
  upstream for non-technical reasons. Requires anyio &amp;gt;= 4.5.0.
  &lt;a href="https://codeberg.org/httpxyz/httpcorexyz/commit/4a4eb1eff2594af449cbc4168e63385c2638a3d2"&gt;ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Retire &lt;code&gt;map_exceptions()&lt;/code&gt; context manager in favour of plain &lt;code&gt;try/except&lt;/code&gt; on
  hot paths (socket reads, writes, connects). &lt;code&gt;try/except&lt;/code&gt; with no exception is
  nearly free; &lt;code&gt;@contextmanager&lt;/code&gt;-based &lt;code&gt;with&lt;/code&gt; blocks have measurable overhead.
  (encode/httpcore#1044)
  &lt;a href="https://codeberg.org/httpxyz/httpcorexyz/pulls/14"&gt;PR 14&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Make &lt;code&gt;Origin&lt;/code&gt; hashable via &lt;code&gt;Origin.__hash__()&lt;/code&gt; for use in sets and dicts.
  (encode/httpcore#1038)&lt;/li&gt;
&lt;li&gt;Release the HTTP/2 max-streams semaphore and decrement &lt;code&gt;_concurrent_streams&lt;/code&gt;
  when &lt;code&gt;NoAvailableStreamIDError&lt;/code&gt; is raised, preventing permanent deadlock.
  (encode/httpcore#1061)
  &lt;a href="https://codeberg.org/httpxyz/httpcorexyz/pulls/10"&gt;PR 10&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Move &lt;code&gt;del self._events[stream_id]&lt;/code&gt; inside the &lt;code&gt;_state_lock&lt;/code&gt; in
  &lt;code&gt;_response_closed()&lt;/code&gt; to prevent a race condition with concurrent coroutines.
  (encode/httpcore#1062)&lt;/li&gt;
&lt;li&gt;Close proxy connection when tunnel TLS handshake fails, preventing the pool
  from stalling at &lt;code&gt;max_connections&lt;/code&gt;. (encode/httpcore#1049)&lt;/li&gt;
&lt;li&gt;Propagate the connect timeout through the SOCKS5 handshake to prevent
  indefinite hangs with non-responsive proxies. (encode/httpcore#1055)
  &lt;a href="https://codeberg.org/httpxyz/httpcorexyz/commit/038793021a14e70039c62137c2a9bd16627adfa4"&gt;ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Explicitly close async generators via &lt;code&gt;safe_async_iterate()&lt;/code&gt; context managers
  to prevent Trio warnings and unpredictable GC-dependent behaviour.
  (encode/httpcore#1019)
  &lt;a href="https://codeberg.org/httpxyz/httpcorexyz/commit/c4e9340375836a5202b946e18e8de98c3d1f8846"&gt;ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Reduce lock contention in &lt;code&gt;PoolByteStream.close()&lt;/code&gt;: pool requests are marked
  as closed outside the lock and cleaned up lazily inside
  &lt;code&gt;_assign_requests_to_connections()&lt;/code&gt;. (encode/httpcore#1038)
  &lt;a href="https://codeberg.org/httpxyz/httpcorexyz/commit/9d86b4472dadc6c8d6dfebdc988922378081a713"&gt;ref&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These are serious issues, and it&amp;rsquo;s not even all. Almost all of these were
already fixed by &amp;lsquo;the community&amp;rsquo; and were living in unmerged pull requests. We
code reviewed them, fixed them up where needed and adapted them to our code
base. We also now added a
&lt;a href="https://codeberg.org/httpxyz/httpcorexyz/src/branch/main/docs/benchmarks.md"&gt;benchmarks&lt;/a&gt;
section to the documentation; httpxyz is now MUCH faster than httpx in many
serious use cases.&lt;/p&gt;
&lt;p&gt;Then we released a new version of HTTPXYZ earlier this week:
&lt;a href="https://codeberg.org/httpxyz/httpxyz/src/branch/main/CHANGELOG.md#0-31-0-25th-april-2026-now-on-httpcorexyz-with-major-performance-improvements"&gt;0.31.0&lt;/a&gt;
with this updated version of httpcorexyz and also more bug fixes of its own.&lt;/p&gt;
&lt;p&gt;Where I previously stated having the fork is about future-proofing and I would
not necessarily recommend people to switch to httpx, with this new version
0.31.0 I now feel that you should definitely move to httpxyz. With All new
fixes and performance improvements it now makes &amp;lsquo;business sense&amp;rsquo; to switch from
httpx to httpxyz, the &amp;lsquo;churn&amp;rsquo; is worth it now!&lt;/p&gt;
&lt;h2&gt;Adoption&lt;/h2&gt;
&lt;p&gt;We&amp;rsquo;re happy to see projects moving to using our package, even though it&amp;rsquo;s not
much yet. We encourage everyone to do so, and please tell others and convince
them! If you would find issues with your switchover, which I do not expect,
please just open &lt;a href="https://codeberg.org/httpxyz/httpxyz/issues"&gt;an issue&lt;/a&gt; and
I&amp;rsquo;m sure we can figure it out!&lt;/p&gt;
&lt;h2&gt;Quotes&lt;/h2&gt;
&lt;blockquote&gt;&lt;p&gt;I'm a big user of httpx... Thanks for the fork. Here's to hoping it gained some traction. (Michael Kennedy, Founder, Talk Python)&lt;/p&gt;&lt;/blockquote&gt;

&lt;blockquote&gt;&lt;p&gt;Thank you for forking httpx. httpx is a joy to work with, but clearly a bit dead in the water. Really nice to see it moving forward again. (hhartzer)&lt;/p&gt;&lt;/blockquote&gt;

&lt;blockquote&gt;&lt;p&gt;If you want to have traction, you should probably move to GitHub instead of using Codeberg (Marcelo Trylesinski aka Kludex / FastAPI)&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;On Codeberg&lt;/h2&gt;
&lt;p&gt;We explained &lt;a href="httpxyz.html"&gt;the last time&lt;/a&gt; why we chose Codeberg; we&amp;rsquo;re not
unhappy about our choice. We got 39 &amp;lsquo;stars&amp;rsquo; so far on our
&lt;a href="https://codeberg.org/httpxyz/httpxyz"&gt;Codeberg repository&lt;/a&gt; and many of those
are from &amp;lsquo;fresh&amp;rsquo; accounts. If us being on codeberg helps a tiny little bit
making github a bit less dominant, I think this is a good thing, and I hope it
can inspire other projects to do the same. And after all, for most users, who
would just &lt;code&gt;pip install httpxyz&lt;/code&gt; or &lt;code&gt;uv add httpxyz&lt;/code&gt; it does not matter where
the source is hosted.&lt;/p&gt;
&lt;p&gt;Thanks, and have fun!&lt;/p&gt;</content></entry><entry><title>Talk at PyAmsterdam on httpxyz</title><link href="https://tildeweb.nl/~michiel/pyamsterdam-httpxyz.html" rel="alternate"/><published>2026-04-21T22:00:00+02:00</published><updated>2026-04-21T22:00:00+02:00</updated><author><name>Michiel W. Beijen</name></author><id>tag:tildeweb.nl,2026-04-21:/~michiel/pyamsterdam-httpxyz.html</id><summary type="html">I'm giving a lightning talk on our new Python package httpxyz!</summary><content type="html">&lt;p&gt;On Wednesday 29th of April 2026 I will be giving a lightning talk on our new
fork of the popular python package &lt;strong&gt;httpx&lt;/strong&gt; called
&lt;a href="https://httpxyz.org"&gt;httpxyz&lt;/a&gt; at PyAmsterdam. &lt;strong&gt;httpx&lt;/strong&gt; is a top-100 Python
package for sending http requests but has not had a release since end of 2024,
plus, recently all issues were set to hidden and all discussions are closed.
&lt;strong&gt;httpxyz&lt;/strong&gt; is our friendly fork with lots of fixes for serious and more niche
issues. Read for more info my &lt;a href="httpxyz.html"&gt;announcement post for httpxyz&lt;/a&gt;. I
will talk about why we did the fork and how we approach it. The event is fully
booked and there is a wait list.&lt;/p&gt;
&lt;p&gt;As the organizer of Python Leiden, I am happy to be checking out another Python
meetup group.&lt;/p&gt;
&lt;p&gt;Plus, I&amp;rsquo;m excited to be giving a talk on HTTPXYZ; my first blog post about it
got a lot of views on Hacker News but not (yet) so much adoption in real life,
and we definitely need to &amp;ldquo;spread the word&amp;rdquo; more.&lt;/p&gt;
&lt;p&gt;I look forward to giving my talk &amp;amp; see you there!&lt;/p&gt;
&lt;p&gt;&lt;img alt="PyAmsterdam flag" class="small" src="images/pyamsterdam-flag.png"&gt;&lt;/p&gt;
&lt;p&gt;Check the details for the
&lt;a href="https://www.meetup.com/pyamsterdam/events/313647263/"&gt;Meetup.com event&lt;/a&gt;&lt;/p&gt;</content></entry><entry><title>Why I forked httpx</title><link href="https://tildeweb.nl/~michiel/httpxyz.html" rel="alternate"/><published>2026-03-25T22:00:00+01:00</published><updated>2026-03-25T22:00:00+01:00</updated><author><name>Michiel W. Beijen</name></author><id>tag:tildeweb.nl,2026-03-25:/~michiel/httpxyz.html</id><summary type="html">I forked the python library httpx to httpxyz after over a year without a release of this popular package</summary><content type="html">&lt;p&gt;Yesterday I forked &lt;a href="https://github.com/encode/httpx"&gt;httpx&lt;/a&gt;. The new fork is
called &lt;a href="https://httpxyz.org"&gt;httpxyz&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Reasons for the fork&lt;/h2&gt;
&lt;p&gt;HTTPX is a very popular HTTP client for Python. There is lots of code depending
on it.&lt;/p&gt;
&lt;p&gt;In 2024, I contributed zstd content decoding. This got merged and released! I
was very happy and proud. Then I found out it was broken. I contributed a fix.
The fix was ignored and there was never any release since November 2024. Me,
and others, asked repeatedly for a release containing my fix. I sent email to
the author personally. I got response when I added that I was considering
forking. The author replied &amp;ldquo;1.0 development is on course&amp;rdquo;. Which is probably
true but it has been in the planning for over two years now
&lt;a href="https://github.com/encode/httpx/pull/3069"&gt;ref&lt;/a&gt;. Even the &amp;lsquo;patch level&amp;rsquo;
release for 0.28.2
&lt;a href="https://github.com/encode/httpx/pull/3525"&gt;has been in draft for over a year&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And apart from this, there&amp;rsquo;s:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Recently issues have been made hidden on the github repository, and
  discussions have been turned off. Having issues hidden makes it more
  difficult for people to contribute to the package but also to use the package
  since issues are linked all over in code and documentation also. See
  &lt;a href="https://www.reddit.com/r/Python/comments/1rl5kuq/anyone_know_whats_up_with_httpx/"&gt;reddit thread&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;There has been talk about an upcoming 1.0 release for years now, back to 2020
  or so. In a discussion from October 2024, it was laid out that the 1.0 might
  look very different than the current version of httpx. Simon Willison added
  his points eloquently, please
  &lt;a href="https://github.com/encode/httpx/discussions/3344#discussioncomment-14170874"&gt;read them&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Probably as a result, both
  &lt;a href="https://github.com/openai/openai-python/blob/acd0c54d8a68efeedde0e5b4e6c310eef1ce7867/pyproject.toml#L12"&gt;openai&lt;/a&gt;
  and
  &lt;a href="https://github.com/anthropics/anthropic-sdk-python/blob/d7c0974ce6ab94ca135b10b2a45308203c0e0c7e/pyproject.toml#L12"&gt;anthropic&lt;/a&gt;
  python packages, that depend on httpx, have put guards in their
  pyproject.toml to not install version 1.0.&lt;/li&gt;
&lt;li&gt;The author previously added breaking changes in minor updates, causing churn
  for many people, stating &amp;ldquo;&lt;em&gt;The &lt;code&gt;httpx&lt;/code&gt; package is not yet at a 1.0 SEMVER
  release&lt;/em&gt;&amp;rdquo; &lt;a href="https://github.com/encode/httpx/discussions/3436"&gt;ref&lt;/a&gt;. It&amp;rsquo;s
  pre-1.0, that is right, but if so many people use your package a bit more
  consideration for compatibility seems in place.&lt;/li&gt;
&lt;li&gt;The author also created Django REST framework, and turned off issues and
  discussions there, a little over a year ago. This made life for people using
  the product more difficult
  &lt;a href="https://github.com/orgs/encode/discussions/11#discussioncomment-12311196"&gt;ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The author also created MkDocs, of which an interesting
  &lt;a href="https://fpgmaas.com/blog/collapse-of-mkdocs/"&gt;blog post&lt;/a&gt; was published
  recently. Some patterns seem to be recurring.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All this together made me think creating a fork is the best way forward, to
provide a stable path for people invested in httpx.&lt;/p&gt;
&lt;p&gt;I do understand about maintainer burnout, and preferring to work on &amp;lsquo;next&amp;rsquo;, and
that there is life outside of Python, but I think not doing anything for
maintenance and also not letting other people help out in maintaining, for such
a high profile module, is problematic.&lt;/p&gt;
&lt;p&gt;I do hope that Kim will go on to make much more beautiful software and that
there will be a HTTPX2 that will be excellent!&lt;/p&gt;
&lt;h2&gt;FAQ&lt;/h2&gt;
&lt;h3&gt;Q: Why did you fork?&lt;/h3&gt;
&lt;p&gt;See all the reasons above&lt;/p&gt;
&lt;h3&gt;Q: So what is the plan now?&lt;/h3&gt;
&lt;p&gt;Maintain a stable fork of httpx. No great rewrites, no breaking changes, no big
changes to the project setup (for now). The motto is: &lt;em&gt;Move a little faster and
not break things&lt;/em&gt;.&lt;/p&gt;
&lt;h3&gt;Q: But are you not also going to burn out? Surely it&amp;rsquo;s lots of work&lt;/h3&gt;
&lt;p&gt;There has been &lt;em&gt;no&lt;/em&gt; release since 2024 for httpx. A little more frequent would
go a long way. My buddy &lt;a href="https://sanderwegter.nl"&gt;Sander Wegter&lt;/a&gt; is a
co-maintainer to spread the load.&lt;/p&gt;
&lt;h3&gt;Q: Why is your code on Codeberg and not on Github?&lt;/h3&gt;
&lt;p&gt;I feel that as a tech community we have put too many eggs in one basket. GitHub
has been great for developers over the years, but I&amp;rsquo;m worried about the
monoculture. Codeberg is still a little &amp;ldquo;rough&amp;rdquo; but for most intents and
purposes, it just works. You can see the repository
&lt;a href="https://codeberg.org/httpxyz/httpxyz"&gt;here&lt;/a&gt;. Codeberg is run as a non-profit
instead of by a megacorp. Plus, I spoke with a bunch of them on FOSDEM this
year and they&amp;rsquo;re very nice people.&lt;/p&gt;
&lt;h3&gt;Q: Should I port all my code &lt;em&gt;now&lt;/em&gt;?&lt;/h3&gt;
&lt;p&gt;If you want, you&amp;rsquo;d be welcome. But if everything just works for you now, I&amp;rsquo;m
not sure it&amp;rsquo;s warranted. The idea is that there &lt;em&gt;is&lt;/em&gt; a path for you if you need
it. That said, we&amp;rsquo;re
&lt;a href="https://codeberg.org/httpxyz/httpxyz/src/branch/main/CHANGELOG.md"&gt;fixing lots of bugs&lt;/a&gt;.
&lt;em&gt;UPDATE: with our new fixes we changed this position; httpxyz is much faster
now than httpx and has much less bugs, we encourage everyone to upgrade!
&lt;a href="httpxyz-one-month-in.html"&gt;ref: httpxyz one month in&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;Q: but what about plugins?&lt;/h3&gt;
&lt;p&gt;If you&amp;rsquo;d use &lt;code&gt;import httpxyz as httpx&lt;/code&gt;, many things will just work. And for
packages that itself depend on httpx, if you &lt;code&gt;import httpxyz&lt;/code&gt; before you load
that package, you&amp;rsquo;ll use our new package instead. See
&lt;a href="https://httpxyz.org/httpx-compatibility/"&gt;httpx compatibility&lt;/a&gt; I think that
with the 0.3.0 release we&amp;rsquo;ve covered all bases, if you still have problems,
please just open &lt;a href="https://codeberg.org/httpxyz/httpxyz/issues"&gt;an issue&lt;/a&gt; and
I&amp;rsquo;m sure we can figure it out!&lt;/p&gt;
&lt;p&gt;Thanks, and have fun!&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Discussion on Hacker News
&lt;a href="https://news.ycombinator.com/item?id=47514603"&gt;here&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;</content></entry></feed>