

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: TCP to HTTP
incomplete
2: The RFCs
incomplete
3: HTTP Post
incomplete
4: cURL
incomplete
This lesson's interactive features are locked, please to keep using them
You probably already figured this out (or knew), but curl is a command line tool for making HTTP requests. If you cat the /tmp/rawget.http file that we created, you should have something very similar to this:
GET /goodies HTTP/1.1
Host: localhost:42069
User-Agent: curl/8.6.0
Accept: */*
This is what a raw HTTP message looks like - specifically a raw HTTP GET request.
GET /goodies HTTP/1.1Host: localhost:42069, User-Agent: curl/8.6.0, Accept: */*Let's see what a raw HTTP POST request (with a body) looks like...
go run ./cmd/tcplistener | tee /tmp/rawpost.http
curl -X POST -H "Content-Type: application/json" -d '{"flavor":"dark mode"}' http://localhost:42069/coffee
Again, this time your cURL command will hang, but this time, you might notice that the body ({"flavor":"dark mode"}) isn't showing up yet in the tcplistener output... and that's because it doesn't end with a newline.
Run and submit the CLI tests.