Files
lab_riddles/notes.md
njmason22 9f954f5372 notes.md
2026-02-12 16:04:31 -05:00

156 lines
4.5 KiB
Markdown

# Request and response notes
## Checkpoint 1
Read the request and response shown on lines 1-32 of the lab. Choose
five lines from the request and/or the response. For each, make an inference
about the meaning of the line, and some situation in which it might be useful.
You are welcome to research the meanings of these headers, but it's also
fine to speculate for now.
1$ http -v get https://riddles.makingwithcode.org/all ## -v means verbose -
## "It shows headers, body, and metadata for both the request and the response." - Google Search
2GET /all HTTP/1.1 ## GET means retrieve the following URL in read-only mode.
3Accept: */* ## */* means wildcard for "all files".
4Accept-Encoding: gzip, deflate ## IDK
5Connection: keep-alive ## IDK
6Host: riddles.makingwithcode.org ## Host is the server name here.
7User-Agent: HTTPie/3.2.1 ## tells you what version of the HTTPie Command-Line
## HTTP Client is running on Ubuntu OS.
## Checkpoint 2
The goal of this checkpoint is to see what status codes you can get back from
the riddle server. Paste below several `http` requests and the status codes
they return.
## https://riddles.makingwithcode.org - No such file or directory
## http get https://riddles.makingwithcode.org
## HTTP/1.1 404 Not Found
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
Cross-Origin-Opener-Policy: same-origin
Date: Thu, 12 Feb 2026 20:49:54 GMT
Referrer-Policy: same-origin
Server: nginx/1.24.0 (Ubuntu)
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
<!doctype html>
<html lang="en">
<head>
<title>Not Found</title>
</head>
<body>
<h1>Not Found</h1><p>The requested resource was not found on this server.</p>
</body>
</html>
## http get https://riddles.makingwithcode.org/all
## HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 1484
Content-Type: application/json
Cross-Origin-Opener-Policy: same-origin
Date: Thu, 12 Feb 2026 20:52:08 GMT
Referrer-Policy: same-origin
Server: nginx/1.24.0 (Ubuntu)
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
{
"riddles": [
{
"correct": 0,
"difficulty": 0.0,
"guesses": 0,
"id": 7,
"question": "how did the triangle hit on the other triangle?"
},
{
"correct": 2,
"difficulty": 0.0,
"guesses": 2,
"id": 10,
"question": "what's my favorite color?"
},
{
"correct": 1,
"difficulty": 0.0,
"guesses": 1,
"id": 11,
"question": "hello"
},
{
"correct": 0,
"difficulty": 0.0,
"guesses": 0,
"id": 12,
"question": "What have I got in my pocket?"
},
{
"correct": 0,
"difficulty": 0.0,
"guesses": 0,
"id": 13,
"question": "What have I got in my pocket?"
},
{
"correct": 4,
"difficulty": 0.16666666666666663,
"guesses": 5,
"id": 2,
"question": "What did the triangle say to the cirle?"
},
{
"correct": 1,
"difficulty": 0.33333333333333337,
"guesses": 2,
"id": 5,
"question": "What have I got in my pocket?"
},
{
"correct": 1,
"difficulty": 0.33333333333333337,
"guesses": 2,
"id": 6,
"question": "What has to be broken before you can use it?"
},
{
"correct": 0,
"difficulty": 0.5,
"guesses": 1,
"id": 8,
"question": "What have I got in my pocket?"
},
{
"correct": 6,
"difficulty": 0.5333333333333333,
"guesses": 14,
"id": 1,
"question": "Where do you get dragon milk?"
},
{
"correct": 0,
"difficulty": 0.6666666666666667,
"guesses": 2,
"id": 9,
"question": "What have I got in my pocket?"
},
{
"correct": 2,
"difficulty": 0.7857142857142857,
"guesses": 13,
"id": 3,
"question": "What have I got in my pocket?"
},
{
"correct": 0,
"difficulty": 0.8333333333333334,
"guesses": 5,
"id": 4,
"question": "How many eggs can a rooster lay?"
}
]
}