Lecture 7, 20-755: The Internet, Summer 1999 1 20-755: The Internet Lecture 7: Web Services I David O’Hallaron School of Computer Science and Department of Electrical and Computer Engineering Carnegie Mellon University Institute for eCommerce, Summer 1999
20-755: The Internet Lecture 7: Web Services I. David O’Hallaron School of Computer Science and Department of Electrical and Computer Engineering Carnegie Mellon University Institute for eCommerce, Summer 1999. Today’s lecture. Web history and HTTP intro (30 min) Break (10 min) - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Lecture 7, 20-755: The Internet, Summer 1999 1
20-755: The InternetLecture 7: Web Services I
David O’Hallaron
School of Computer Science and
Department of Electrical and Computer Engineering
Carnegie Mellon University
Institute for eCommerce, Summer 1999
Lecture 7, 20-755: The Internet, Summer 1999 2
Today’s lecture
• Web history and HTTP intro (30 min)
• Break (10 min)
• HTTP/1.1 methods (50 min)
Lecture 7, 20-755: The Internet, Summer 1999 3
Web history
• 1945: – Vannevar Bush, “As we may think”, Atlantic Monthly,
July, 1945.
» Describes the idea of a distributed hypertext system.
» a “memex” that mimics the “web of trails” in our minds.
• 1989:– Tim Berners-Lee (CERN) writes internal proposal to
develop a distributed hypertext system.
» connects “a web of notes with links”.
» intended to help CERN physicists in large projects share and manage information
• 1990:– Tim BL writes graphical browser for Next machines.
Lecture 7, 20-755: The Internet, Summer 1999 4
Web history (cont)
• 1992– NCSA server released
– 26 WWW servers worldwide
• 1993– Marc Andreessen releases first version of NCSA Mosaic
(Feb)
– Mosaic version released for (Windows, Mac, Unix).
– Web (port 80) traffic at 1% of NSFNET backbone traffic.
– Over 200 WWW servers worldwide.
• 1994– Andreessen and colleagues leave NCSA to form "Mosaic
Communications Corp" (now Netscape).
Lecture 7, 20-755: The Internet, Summer 1999 5
Web server statistics
source: Netcraft Web Survey www.netcraft.com/survey
Apache
Microsoft
Other
Mosaic
Netscape
Lecture 7, 20-755: The Internet, Summer 1999 6
Web services
webclient
(browser)
webserver
HTTP request
HTTP response
• Clients and servers communicate using the HyperText Transfer Protocol (HTTP)
• Current version is HTTP/1.1
– RFC 2616, June, 1999.
Lecture 7, 20-755: The Internet, Summer 1999 7
Static and dynamic content
• The content returned in HTTP responses can be either static or dynamic.
• Static content: – content stored in files and retrieved in response to an
HTTP request
» HTML files
» images
» audio clips
• Dynamic content:– content produced on-the-fly in response to an HTTP
request
» usually by CGI process executed by the server.
Lecture 7, 20-755: The Internet, Summer 1999 8
Backus-Naur Form (BNF)• BNF is a way to write grammars that specify
computer languages, protocols, and command line arguments to programs (and many others)
– BNF describes the legal strings for that language or protocol
• The HTTP spec uses the following BNF constructs (among others):
– “literal”
» literal text
– rule1 | rule2
» rule 1 or rule 2 is allowed
Lecture 7, 20-755: The Internet, Summer 1999 9
BNF (cont)
• HTTP BNF constructs– (rule1 rule2)
» sequence of elements: rule1 followed by rule2
» (elem (foo | bar) elem)
– “elem foo elem” or “elem bar elem” are allowed.
– <n>*<m>(element)
» at least m and at most n occurences of element.
» default values are n=0 and m=infinity.
» *(element) allows zero or more occurences of element.
» 1(element) requires at least one element.
» 1*2(element) allows one or two.
– [rule]
» rule is optional
Lecture 7, 20-755: The Internet, Summer 1999 10
BNF (cont)
• Basic rules– OCTET = <any 8-bit sequence of data>
– CHAR = <any ASCI I char>
– ALPHA = <A...Z and a...z>
– DIGIT = <0…9>
– SP = <ASCII SPACE character (32)>
– CRLF = <newline \n>
– TEXT = <printable ASCII chars>
Lecture 7, 20-755: The Internet, Summer 1999 11
URIs and URLs
• network resources are identified by Universal Resource Indicators (URIs)
• The most familiar is the absolute URI known as the HTTP URL:– http-url = “http:” “//” host [“:” port] [abs_path]– port defaults to “80”– abs_path defaults to “/”– abs_path ending in / defaults to …/index.html
kittyhawk> telnet espn.com 80Trying 204.202.136.31...Connected to espn.com.Escape character is '^]'.
HEAD / HTTP/1.1Host: espn.comCRLFHTTP/1.1 301 Document MovedServer: Microsoft-IIS/4.0Date: Fri, 23 Jul 1999 03:22:32 GMTLocation: http://espn.go.com/Content-Type: text/htmlCRLF<html>Is now part of the http://espn.go.com service<br></html>
Modern browserstransparently
connect to the newespn.go.com location
Lecture 7, 20-755: The Internet, Summer 1999 37
POST
• Another technique for producing dynamic content.
• Executes program identified in request URI (the CGI program).
• Passes arguments to CGI program in the message body
– unlike GET, which passes the arguments in the URI itself.