>_ IzzyLab

Topic breakdown

When a browser opens a page, it sends the server an HTTP request and shows the answer it gets back. In the terminal curl does the same.

A page address (URL) is made of parts:

http://example.local:3000/docs/start.html
└─┬─┘   └─────┬─────┘ └┬─┘└──────┬──────┘
scheme      name      port     path

You can leave the port out if it's the standard one: 80 for http, 443 for https. localhost is a name that always leads to this same machine.

curl http://example.local:3000/docs/start.html               # print the page on screen
curl -o start.html http://example.local:3000/docs/start.html # save it to start.html
curl -i http://example.local:3000/docs/start.html            # the same, plus the response headers

Headers are service lines the server sends before the page itself: the response code, the content type, the size. Normally you don't see them; -i shows them.

What's checked

  1. File /root/notice.txt created
  2. The file has no service headers
  3. The file holds exactly what the server sent for this address

What it looks like