open atlas
↑ Back to track
Networking & Protocols NET · 06 · 09

HTTP versions: header and trace reading

Read real HTTP headers, a curl trace, and a gRPC exchange; predict the behaviour and pick the highest-leverage fix a senior engineer would make first.

NET Senior ◷ 14 min
Level
FoundationsJuniorMiddleSenior

Wire dumps and response headers are where HTTP problems are actually diagnosed. Read the exchange, predict what the browser, CDN, or QUIC stack will do, then choose the fix a senior engineer reaches for first.

Goal

Practise the loop you run in every HTTP incident: read the headers and the trace, predict the protocol-level behaviour, and reach for the structural fix before tuning anything.

Snippet 1 — the Alt-Svc advertisement

$ curl -v https://api.example.com/health
* ALPN: server accepted h2
< HTTP/2 200 OK
< alt-svc: h3=":443"; ma=86400
< x-quic-version: draft-29
< content-type: application/json
{"status":"ok"}

$ curl --http3-only https://api.example.com/health
* QUIC handshake fail: protocol violation: invalid initial packet
Quiz

The server advertises h3 via Alt-Svc but the HTTP/3 handshake fails. What is wrong, and what is the first fix?

Snippet 2 — the cached user profile

GET /api/user/profile HTTP/2
authorization: Bearer eyJ...userA

HTTP/2 200 OK
content-type: application/json
cache-control: max-age=300
{"id":"userA","email":"a@example.com"}
Quiz

Users report seeing each other's profiles intermittently. Reading only these headers, what is the bug and the correct fix?

Snippet 3 — the gRPC response

HTTP/2 200 OK
content-type: application/grpc

(DATA frames: serialized protobuf message)

(trailing HEADERS frame)
grpc-status: 5
grpc-message: user not found
Quiz

The HTTP status is 200 but grpc-status is 5 (NOT_FOUND). Why is the result in a trailer, and what breaks if a browser calls this directly?

Snippet 4 — the priority hints

:method = GET
:path = /hero.jpg
priority = u=5

:method = GET
:path = /critical.css
priority = u=1
Quiz

Both requests arrive at once over HTTP/3. Reading the RFC 9218 Priority headers, which does the server send first, and what is the rule?

Recap

Every HTTP incident is read in headers and traces: an Alt-Svc h3 hint backed by a draft-QUIC stack wastes an RTT per client; a per-user response missing private/no-store and Vary leaks across a shared cache; gRPC’s real outcome lives in a trailing HEADERS frame (200 at the HTTP level) and needs gRPC-Web for browsers; and RFC 9218 urgency is inverted — lower u is more urgent. Read the wire, predict the protocol behaviour, then apply the structural fix.

Something unclear?

Ask a question about this lesson. Questions are anonymous and go straight to the author to make the lesson better.

shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.