I wrote the answers to both checkpoints and fixed the codes in api.py to implement client.py.

1. I use Google almost every day, especially for searching things quickly.
When I type something into the search bar and press enter, my device
sends an HTTP request to Google’s servers with my search words.
Google then sends back an HTTP response with the search results,
which show up on my screen.
2. Yes, this lab helped me understand that my devices are constantly
communicating with servers without me even noticing.
This commit is contained in:
juddin22
2026-02-14 17:43:32 -05:00
parent c3d3c22885
commit 79561be8e3
3 changed files with 237 additions and 13 deletions

View File

@@ -1,13 +1,27 @@
# 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.
3.Accept: */* : This line from request portion means that the request was accepted.
4.Accept-Encoding: gzip, deflate: This line means that client can receive information written in gzip.
5.Connection: keep-alive: This line means that make sure the connection to the server stays open.
6.Host: riddles.makingwithcode.org: This line means that the request is sent to this server.
16.Date: Tue, 05 Mar 2024 00:25:26 GMT: The date the information was received from the server.
## 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.
http -v post https://google.com/guess id=1 answer="she is short"
HTTP/1.1 404 Not Found
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Connection: close
Content-Length: 1566
Content-Type: text/html; charset=UTF-8
Date: Sat, 14 Feb 2026 22:10:30 GMT
Referrer-Policy: no-referrer
http -v get https://google.com/new question="Is Obama still alive?" answer="yes"
HTTP/1.0 400 Bad Request
Content-Length: 1555
Content-Type: text/html; charset=UTF-8
Date: Sat, 14 Feb 2026 22:15:27 GMT
Referrer-Policy: no-referrer