lab_riddles/notes.md

2.1 KiB

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.

line 6 tells us exactly what the host address is which could be useful to reference if looking at this and you did not know where the request was being sent to and needed this info while looking at it.

line 11 has a 200 on it which if I recall correctly for cse 115 means that there was not an error. THis would be useful to make sure everything is running smoothly.

line 12 gives us the connection status which says keep-alive. This could be useful if we were trying to figure out if the connection was kept open or closed.

line 16 gives us the date and time when the response was made which could be useful if trying to figure out when a response was sent for a timestamp or something similar.

line 18 gives us the server the response was made on which could be useful if something went wrong and we had to debug. We could check the server for issues (maybe???).

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://riddles.makingwithcode.org/new question="What is salty and flat?" answer="A saltine"

HTTP/1.1 200 OK

http -v post https://riddles.makingwithcode.org/new question="What is salty and flat?" answe="A saltine"

HTTP/1.1 400 Bad Request

http -v post https://riddles.makingwithcode.org/new questio="What is salty and flat?" answer="A saltine"

HTTP/1.1 400 Bad Request

http -v pos https://riddles.makingwithcode.org/new question="What is salty and flat?" answer="A saltine"

HTTP/1.1 405 Method Not Allowed

http -v post https://riddles.makingwithcode.org/new question="What is salty and flat?" answer="A saltine" lol='yeet'

HTTP/1.1 200 OK