CS 33600 Exam 2 Review The exam is on Monday, April 29. The exam is over the reading assignments and the code examples listed on the course web site. Here are a few review problems. Problem 1.) Identify as many parts of the following URLs as you can. http://www.bigcompany.com:42/consumer/products/lookup.php?sku=0&color=greenish http://www.bigcompany.edu:4242/where/was/that/file.scm?x=2+2&bob=a4s56d7v83n https://people.scs.carleton.ca/~lanthier/teaching/COMP1406/Notes/COMP1406_Ch12_NetworkProgramming.pdf#page=6 Problem 2.) What would be the HTTP request message (request line and the most important request headers) for the following URL? http://cs.pnw.edu:80/~rlkraft/cs33600/class.html#2024-03-18 Problem 3.) How does an HTTP server know when it has received the last request header? How does an HTTP client know when it has received the last response header? How does an HTTP server or client know when it has received all of the entity body? An entity body is an array of bytes. An array of byte can be any kind of data. How does an HTTP server or client know what the bytes in an entity body mean? Problem 4.) Explain why, when a browser is told to GET a single URL, like https://www.pnw.edu/ that single URL can easily lead to many actual HTTP GET requests. Problem 5.) Explain why, when a browser is told to GET this URL, http://pnw.edu/ that URL will lead to more HTTP GET requests than this URL, https://www.pnw.edu/ Problem 6.) If a browser sends the following HTTP request to a server, then what was the (complete) URL that the browser was accessing? GET /~rlkraft/cs33600/dynamic.html?data1=cats&data2=dogs HTTP/1.1 Accept: text/html,application/xhtml+xml,application/xml Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.9 Cache-Control: no-cache Connection: keep-alive Host: math.pnw.edu Referer: http://math.pnw.edu/~rlkraft/cs33600/public_html/static.html Problem 7.) When a browser needs to send data to a dynamic web application running on an HTTP server, the browser can use either the http GET method or the http POST method. Give two differences between using GET and POST. Problem 8.) What is the meaning of this HTTP response? HTTP/1.0 301 Moved Permanently Location: http://www.MergedCompany.com/ Server: BigIP Connection: Keep-Alive Content-Length: 0 Problem 9.) The next few problems use the Windows curl program. https://curl.se/windows/microsoft.html Explain the difference in the results of this curl command > curl -v -H "Accept-Encoding: gzip" https://www.pnw.edu and this curl command. > curl -v https://www.pnw.edu Problem 10.) Look carefully at the result from this curl command, > curl https://www.google.com/search?q=Rome and this curl command. > curl -A bob https://www.google.com/search?q=Rome What do you think explains the difference? Hint: You can add the -v option to the curl command-lines to get more clues. Problem 11.) Explain the difference in the results of this curl command > curl http://cs.pnw.edu/~rlkraft/cs33600/cs33600.html and this curl command. > curl -H "If-Modified-Since: Mon, 22 Apr 2024 00:00:00 GMT" http://cs.pnw.edu/~rlkraft/cs33600/cs33600.html Hint: Add the -v option to the curl command-lines to get more clues. Problem 12.) Explain the difference in the results of this curl command > curl http://cs.pnw.edu/~rlkraft/cs33600/cs33600.html and this curl command. > curl -H "Range: bytes=1000-1400" http://cs.pnw.edu/~rlkraft/cs33600/cs33600.html Hint: Add the -v option to the curl command-lines to get more clues. Problem 13.) Why doesn't the HTTP protocol use a sentinel value to mark the end of an entity body? Problem 14.) Run the http server from class, http://cs.pnw.edu/~rlkraft/cs33600/for-class/httpServer.zip using the run-http-server.cmd script file. Enter this URL into your browser. http://localhost:8080/static.html#part2 What URL is sent by the browser to the server? Why? What is displayed by the browser? Use curl with the same URL. > curl -v http://localhost:8080/static.html#part2 What URL did curl send to the server? What was sent back by the server to the curl client? What happened to the fragment?