CS174
Chris Pollett
Feb 3, 2021
On Monday, we introduced HTTP, the protocol above TCP/IP for retrieving hypertext documents. I.e., web pages. We start today by going over in a little more detail how it works, and then switch to talking about HTML, the language that web pages are written in.
HTTP method path part of URL HTTP version Header fields Blank line Message Body
For example, at a Unix prompt trying typing: telnet www.cs.sjsu.edu 80 GET / HTTP/1.0 <blank line>
GET --- request contents of specified document HEAD --- request header contents of specified document POST --- Executes the specified document, using the enclosed data PUT --- replaces the specified document with the enclosed data DELETE ---deletes the specified document.
GET /respond.html HTTP/1.1 Host: blanca.uccs.edu Accept: text/* Accept: image/gif
Status line Response header fields Blank line Response body
HTTP/1.1 200 OK
HTTP/1.1 200 OK Date: Mon, 28 Aug 2006 19:09:45 GMT Server: Apache/2.2.2 (Fedora) Accept-Ranges: bytes Connection: close Content-Type: text/html Message Body
ISO HTML (HTML 4.01) which is specified using SGML a XHTML 1.0 Transitional XHTML 1.0 STRICT XHTML 1.1 HTML 5/XHTML 5 HTML LS
<img src="my_picture.png" ></img> <!-- this is okay in an XHTML document (not in HTML 5). BTW, this is an example HTML comment --> <img src="my_picture.png" /> <!--this is okay for both XHTML and HTML 5 and is an abbreviation for the line above --> <img src="my_picture.png" > <!--okay only in HTML 5, but don't use for this class --> <P>old style paragraph</P> <!--okay only in HTML 5, but don't use for this class --> <p><i>Hello</i></p> <!--okay --> <p><i>Hello</p></i> <!--not okay -->Open tags may have attributes. For example, src in the image tag above. The value of an attribute must be given in double quotes or single quotes for XHTML. Quotes are optional for HTML 5.