http.h2
import http
httpexposes this ashttp.h2, soimport httpis enough and the names are called ashttp.h2.*.import http.h2reaches the same definitions directly.
HTTP/2 (RFC 9113) and the header compression it uses (RFC 7541).
HttpServer speaks this automatically: over TLS when ALPN negotiates
h2, and over cleartext when a client opens with the HTTP/2 connection
preface. HttpClient uses it when a server negotiates h2 for an HTTPS
connection.
The pieces are here for anything that needs them directly - a gateway, a test harness, or a protocol that borrows HPACK.
Submodules
| Module | Reached as | Summary |
|---|---|---|
http.h2.connection | http.h2.connection.* | One HTTP/2 connection and the streams multiplexed over it. |
http.h2.frames | http.h2.frames.* | The HTTP/2 frame layer (RFC 9113 §4 and §6): a nine-octet header - a 24-bit length, a type, a flags byte, and… |
http.h2.hpack | http.h2.hpack.* | HPACK, the header compression HTTP/2 uses (RFC 7541). |
http.h2.huffman | http.h2.huffman.* | The static Huffman code HPACK uses to compress header field names and values, from RFC 7541 Appendix B. |
2026, Richard Ore and Zuri contributors