Course of Raku / Functional, concurrent, reactive, and web programming / Web programming / A simple HTTP client / Exercises

A GET request

Problem

Using a core socket, send an HTTP GET request for / to example.com on port 80. From the response, extract just the three-digit status code (the second word of the status line) and print it.

This exercise needs a working network connection.

Example

When run, the program prints:

200

Solution

See the solution

Course navigation

Using a client module   |   Solution: A GET request