Self-Check Questions 7-28
Test Yourself!
Select one answer from questions with circle bubbles. Select all that apply from questions with square bubbles.
- Which of the following statements are TRUE regarding making a request to a server using
cURLvs. visiting the same URL with a browser? (Select all that apply.) (Submit via your course’s platform to get credit.) - After running
curl 'http://randomword.saasbook.info', you save the contents in an appropriate file and view the contents in a browser. Select all options that are TRUE about the preview that renders in the browser. (Select all that apply.) (Submit via your course’s platform to get credit.) - Assuming you run the command
nc -l 5000on a separate window, what command can you use to make HTTP requests to this server? (Select all that apply.) (Submit via your course’s platform to get credit.) - In which of the following would you see
HTTP/1.1 200 OK? (Select all that apply.) (Submit via your course’s platform to get credit.) - In which of the following would you see
GET https://calcentral.berkeley.edu/dashboard HTTP/1.1? (Select all that apply.) (Submit via your course’s platform to get credit.) - What MAY the response headers contain? (Select all that apply.) (Submit via your course’s platform to get credit.)
- What MAY the response body contain? (Select all that apply.) (Submit via your course’s platform to get credit.)
- What does
curl 'http://randomword.saasbook.info'do and what is returned after the command is run? (Submit via your course’s platform to get credit.) - What does
curl -v 'http://randomword.saasbook.info'do and what is returned after the command is run? (Submit via your course’s platform to get credit.) - What does
curl -i 'http://randomword.saasbook.info'do and what is returned after the command is run? (Submit via your course’s platform to get credit.) - What MUST a request header contain? (Select all that apply.) (Submit via your course’s platform to get credit.)
- It is the _____’s job to send
Set-Cookieheaders. (Submit via your course’s platform to get credit.) - It is the _____’s job to remember a cookie that has been sent in a
Set-Cookieheader. (Submit via your course’s platform to get credit.) - What does it mean to say “HTTP is a stateless protocol”? (Submit via your course’s platform to get credit.)
- Briefly explain why HTTP being stateless determines how cookies work. Hint: think back to your responses of the above 3 questions. Describe why the roles must be distributed the way it is. Think about what would go wrong if the responsibilities were switched between the client and server. (Submit via your course’s platform to get credit.)
- Disabling cookies in a browser prevents the server from generating them. (Submit via your course’s platform to get credit.)
- Which of the following are true when comparing requests sent from an incognito window and a regular browser window under identical conditions (Select all that apply.) (Submit via your course’s platform to get credit.)
- Briefly explain how an HTML form is submitted to a server. What happens when the submit button is clicked and what is the role of a web framework like Rails or Sinatra in handling form submissions? (Submit via your course’s platform to get credit.)
- A HTML form can be submitted using
GETinstead ofPOST(Submit via your course’s platform to get credit.) - 4xx errors result from _____ side issues. (Submit via your course’s platform to get credit.)
- 5xx errors result from _____ side issues. (Submit via your course’s platform to get credit.)
- If the client sends a
HTTP GETrequest to a non-existing URI, the response header would have the code _____. (Select all that apply.) (Submit via your course’s platform to get credit.)