Course of Raku / Functional, concurrent, reactive, and web programming / Web programming / Making remote connections / Exercises

Send and receive

Problem

Open a socket to example.com on port 80, send a minimal HTTP HEAD request (which asks only for the headers, not the page body), receive the reply, and print its first line (the status line).

This exercise needs a working network connection to run.

Example

When run, the program prints a line such as:

HTTP/1.1 200 OK

Solution

See the solution

Course navigation

Solution: Connect to a host   |   Solution: Send and receive