Files
lab_riddles/notes.md
juddin22 79561be8e3 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.
2026-02-14 17:43:32 -05:00

27 lines
1.0 KiB
Markdown

# Request and response notes
## Checkpoint 1
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
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