Objective
Compose real HTTP requests and read the raw request line, headers, status code and body the way a browser does.
The idea
A web request is just text over a socket. Build one by hand and see the method, path, headers and status codes that make the web work.
Try this
- 1Send a GET and read the status line and headers.
- 2Send a POST with a body and see where it goes.
- 3Request a missing page and read the 404 response.
- 4Look at the Content-Type header and the body format.
Watch for
- The request line is METHOD path HTTP/version.
- Headers carry metadata in name: value pairs.
- The status code tells you the outcome at a glance.
- The body is where the real payload travels.