skipnothing/HTTP & Networking

Request Lifecycle

curl -v https://example.com/hello prints a dozen lines before the page ever loads, each tagged *, >, or <, and every one is plain text a parser reads top to bottom: no magic, no binary, nothing you cannot spell out yourself.

  • ▸The same four regions carry both directions; only the first line says which is the ask.
  • ▸One missing \r loses the boundary a parser counts line endings to reach, where smuggling bugs start.
  • ▸curl -v is not magic: its > lines are the request you sent, its < lines the reply.
01

One exchange, two messages, one shape

A curl -v run against example.com scrolls past a dozen lines, but strip curl's own notes and only two messages are left on the wire: the one you sent, the one that came back. Both ride above the connection you already opened, at the HTTP layer, and both are built the same way. A single start-line comes first. Then a run of header field lines, each a Name: value pair. Then one empty line. Then, if there is anything to carry, a message body. Request or response, the skeleton does not change. What tells them apart is only that first line: the request opens with a method, the response opens with a version.

DROP EACH LINE INTO ITS REGION

Keep going, sign up to unlock the rest

4 more parts in this topic, plus 23+ more topics in HTTP & Networking.

Sign up, it's freeSee the full HTTP & Networking