2009.highedweb.org2009.highedweb.org/presentations/tpr1.pdf · Created Date: 10/5/2009 3:58:37 PM
Transcript of 2009.highedweb.org2009.highedweb.org/presentations/tpr1.pdf · Created Date: 10/5/2009 3:58:37 PM
HTTP 101OR, WHAT EXACTLY IS UNDER THE HOOD?
Jason Woodward - @jdwcornellTPR1 - #heweb09
TODAY
• http://heweb09.jdwcornell.com/tpr1.html
• I won’t cover everything!
• First: Lecture
• Second: Live Demos
FIREFOX ADD-ONS
• FireBug
• Live HTTP Headers
USER
USER AGENT
REQUEST
GET / HTTP/1.1
HEADERS
Host: www.hotelschool.cornell.eduUser-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5Accept-Language: en-us,en;q=0.5Accept-Encoding: gzip,deflateAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7Keep-Alive: 300Connection: keep-alive
Cookie: __utma=23486248.1379333332.1186101146.1190680468.1191188903.5; __utmz=23486248.1191188903.5.4.utmccn=(referral)|utmcsr=directory.cornell.edu|utmcct=/|utmcmd=referral
REQUEST + HEADERS
GET / HTTP/1.1Host: www.hotelschool.cornell.eduUser-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5Accept-Language: en-us,en;q=0.5Accept-Encoding: gzip,deflateAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7Keep-Alive: 300Connection: keep-aliveCookie: __utma=23486248.1379333332.1186101146.1190680468.1191188903.5; __utmz=23486248.1191188903.5.4.utmccn=(referral)|utmcsr=directory.cornell.edu|utmcct=/|utmcmd=referral
SERVER
RESOURCE
RESPONSE & HEADERSHTTP/1.1 200 OKDate: Tue, 16 Oct 2007 14:36:15 GMTServer: Apache/2.0.59 (Unix) PHP/5.2.1 mod_ssl/2.0.59 OpenSSL/0.9.7a mod_perl/2.0.3 Perl/v5.8.5X-Powered-By: PHP/5.2.1Last-Modified: Tue, 16 Oct 2007 14:36:15 GMTKeep-Alive: timeout=5, max=100Connection: Keep-AliveTransfer-Encoding: chunkedContent-Type: text/html; charset=utf-8
STATUS CODE
HTTP/1.1 200 OK
RENDER
RINSE, REPEAT
CREDENTIALS
SEARCH ENGINE SIGNALING
• HTTP Status Code 301
• “Moved Permanently”
• Signals “there is a new URL for this resource” to the search engine
• HTTP Status Code 302
• “Found”
• Signals “the resource is elsewhere, but only temporarily”
• The “typical” “redirect” used in web applications
(SOME) CACHE CONTROL
• Expires response header: signals to the user agent the time after which the contents of the response are no longer cacheable.
• Last-Modified response header: signals to the user agent the time the server believes the resource was last updated.
• Cache-control request and response headers: user agent and server can signal to one another whether or not they want cached content or fresh content.
404 NOT FOUND
• Status 404: Not Found
• The server evaluated the Request URI and cannot find a matching resource. No indication is given on whether or not this is permanent
• Status 410: Gone
• The requested resource is no longer available at the server and no forwarding address is known
HTTP 101?
10.1.2 101 Switching Protocols
The server understands and is willing to comply with the client's request, via the Upgrade message header field (section 14.42), for a change in the application protocol being used on this connection. The server will switch protocols to those defined by the response's Upgrade header field immediately after the empty line which terminates the 101 response.
The protocol SHOULD be switched only when it is advantageous to do so. For example, switching to a newer version of HTTP is advantageous over older versions, and switching to a real-time, synchronous protocol might be advantageous when delivering resources that use such features.
REVERSE HTTP
HEADERS REVISITED
Host: www.hotelschool.cornell.eduUser-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5Accept-Language: en-us,en;q=0.5Accept-Encoding: gzip,deflateAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7Keep-Alive: 300Connection: keep-alive
Cookie: __utma=23486248.1379333332.1186101146.1190680468.1191188903.5; __utmz=23486248.1191188903.5.4.utmccn=(referral)|utmcsr=directory.cornell.edu|utmcct=/|utmcmd=referral
RESPONSE & HEADERSHTTP/1.1 200 OKDate: Tue, 16 Oct 2007 14:36:15 GMTServer: Apache/2.0.59 (Unix) PHP/5.2.1 mod_ssl/2.0.59 OpenSSL/0.9.7a mod_perl/2.0.3 Perl/v5.8.5X-Powered-By: PHP/5.2.1Last-Modified: Tue, 16 Oct 2007 14:36:15 GMTKeep-Alive: timeout=5, max=100Connection: Keep-AliveTransfer-Encoding: chunkedContent-Type: text/html; charset=utf-8
• HTTP is stateless
• The RFC defines how compliant servers and clients communicate
KEY REMINDERS
DEMOS
Volunteer with a URL?
Questions?