Web
Programming

Fall 2012
course
navigation

Sep 6

discuss homework

Notes:
The assignment for next Tues is up. (There may be too much verbiage in it. The main point is to understand POST, GET, forms, cookies, and to see explicitly the information being passed, in the headers and/or body, either from the command line and/or which tools like the Chrome browser's Developer mode.)

HTTP (Hypertext Transfer Protocol) and all that

(Continue the conversation we started Tuesday.)
Big picture so far:
We're assuming you've had some exposure to the first two. We'll be looking at the third more closely soon.
But first, here is the key question we want to understand next :
What - exactly - happens when a browser requests a web page? * What is the data? * In what form * Sent from what * Caught by what?
Your mission over the weekend is to explore the answer to that question using some interactive tools (browser with developer features, command prompt "telnet host 80", wget|curl, etc) and by online reading|googling.
Here's the starting point for the answer :
Visit the wikipedia page. Point to the related articles. (This is in the week's reading assignment.)
Telnet session example from command prompt :
# connect to port 80 (web server) $ telnet cs.marlboro.edu 80 # Do you speak HTTP ? > GET / HTTP/1.1 > Host: cs.marlboro.edu # The server answers: > HTTP/1.1 200 OK > Date: ... > Server: ... # Other (request ... response) pairs # (all with 2nd line 'Host: cs.marlboro.edu, followed by blank line) GET foo HTTP/1.1 ... HTTP/1.1 400 Bad Request GET /foo HTTP/1.1 ... HTTP/1.1 404 Not Found HEAD / HTTP/1.1 ... HTTP/1.1 200 OK # To www.marlboro.edu HEAD / HTTP/1.1 request Host: marlboro.edu HTTP/1.1 301 Moved Permanently response Location: http://www.marlboro.edu/
Concepts:
Use Chrome developer features and/or Firefox + extensions to watch this happen.

Buzz words:
Peeking under the hood :
Web form demo :
Note also that 'wget' and 'curl' can fetch a web page from the command line, and (see the man pages) do some header/cookie stuff.
And maybe way under the hood :
Related concepts not quite in our curriculum this term:
http://cs.marlboro.edu/ courses/ fall2012/web/ notes/ Sep_6
last modified Thursday September 6 2012 12:17 am EDT