August 2025
Intermediate to advanced
272 pages
6h 14m
English
Most HTTP tooling nowadays supports HTTP/2. Plug and Mint are no exception, so let’s look at examples of using HTTP/2 with these tools.
Here’s the kicker: most of the time, you can (and will) use HTTP/2 without having to do anything explicitly. Try it for yourself. Fire up an IEx session, install Mint, and connect to elixir-lang.org:
| | iex> Mix.install([:mint]) |
| | iex> {:ok, conn} = Mint.HTTP.connect(:https, "elixir-lang.org", 443) |
| | iex> conn.__struct__ |
| | Mint.HTTP2 |
The same goes for the server side: Bandit supports HTTP/2 out of the box, for example.
Plug and Mint also support HTTP/2-specific features, such as push promises and flow control. Let’s use the conn from the previous IEx section to get ...
Read now
Unlock full access