BudiBadu Logo
Samplebadu

cURL by Example: HTTP/3 Request

Latest

Force the use of HTTP/3 (QUIC). Requires a cURL build with HTTP/3 support.

Code

# Force HTTP/3
curl --http3 https://google.com

# Fallback options
curl --http3-only https://example.com

Explanation

HTTP/3 represents a major shift in how web traffic works. It runs over QUIC protocol using UDP instead of TCP, which enables faster connections and better performance on unreliable networks.

Benefits of HTTP/3 and QUIC:

  • Faster connection establishment with 0-RTT resumption
  • Better performance on lossy networks (mobile, WiFi)
  • No head-of-line blocking at the transport layer
  • Connection migration when switching networks
  • Built-in encryption (no unencrypted HTTP/3)

HTTP/3 support in cURL is still maturing. You need a special build with QUIC library support like quiche, ngtcp2, or msh3. Standard cURL packages often don't include HTTP/3 because the libraries are newer and less stable.

To check if your cURL supports HTTP/3, run curl -V and look for HTTP3 in the features line. If it's not there, you'll need to compile cURL yourself or find a pre-built version with QUIC support.

Not all servers support HTTP/3 yet. Google, Cloudflare, and Facebook use it, but many websites still only support HTTP/2 or HTTP/1.1. The --http3 flag will fail if the server doesn't advertise HTTP/3 support.

Code Breakdown

2
--http3 attempts to use HTTP/3.
All
This connects via UDP, not TCP.
Note
Check curl -V to see if HTTP/3 is supported in your build.