

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. Take a good look at the raw HTTP requests that we just sent to our tcplistener program.
GET /goodies HTTP/1.1 # start-line CRLF
Host: localhost:42069 # *( field-line CRLF )
User-Agent: curl/7.81.0 # *( field-line CRLF )
Accept: */* # *( field-line CRLF )
# CRLF
# [ message-body ] (empty)
POST /coffee HTTP/1.1 # start-line CRLF
Host: localhost:42069 # *( field-line CRLF )
User-Agent: curl/8.6.0 # *( field-line CRLF )
Accept: */* # *( field-line CRLF )
Content-Type: application/json # *( field-line CRLF )
Content-Length: 22 # *( field-line CRLF )
# CRLF
{"flavor":"dark mode"} # [ message-body ]
I've annotated the parts for you. Remember, there are really just four parts to an HTTP message:
start-line CRLF
\*( field-line CRLF )
CRLF
[ message-body ]
Answer the question(s).