Networking in C · advanced · ~15 min
Send an HTTP/1.0 request and parse the status line.
HTTP/1.0 is a text protocol over TCP. Connect, write GET /path HTTP/1.0\r\nHost: example\r\n\r\n, read the response.
For the C-platform exercises we restrict to localhost targets — the harness spawns a local server in a thread. Never run such a client against third-party hosts without explicit permission.
const char *req = "GET / HTTP/1.0\r\nHost: localhost\r\n\r\n";
write(s, req, strlen(req));
char buf[4096]; ssize_t n = read(s, buf, sizeof buf - 1);
buf[n] = 0; puts(buf);