For this exercise, you will explore the basics of HTTP conversations.
-
We will start to explore HTTP connections with the most basic tool available: a Telnet connection to port 80. You should be able to do that with any Telnet client; at a Linux/Mac/Windows command prompt, the connection can be made like this:
telnet server 80
First request the URL
http://cmpt470.csil.sfu.ca/~ggbaker/3/
by Telnetting tocmpt470.csil.sfu.ca
on port 80 and making a request like this (with a trailing blank line to indicate the end of the request headers):GET /~ggbaker/3/ HTTP/1.1
Host: cmpt470.csil.sfu.ca
Connection: close[Depending on the server's timeout and the details of your telnet client, you may need to form your requests in a text editor and then copy-and-paste.]
In the email you submit, indicate what the status code was for the server's response.
-
Repeat the request sending an
If-modified-since
header to simulate an existing cached version of the page:GET /~ggbaker/3/ HTTP/1.1
Host: cmpt470.csil.sfu.ca
Connection: close
If-Modified-Since: Wed, 23 May 2012 19:08:26 GMTIn your email, indicate what the status code was for the server's response and how the response differed from the previous question.
-
To see a redirect in action, request the URL
http://cmpt470.csil.sfu.ca/~ggbaker/3
(without the trailing slash) as above.In your email, indicate what the status code was for the server's response and how the response differed from the original request.
- Do at least one of these:
Use Firebug to view the request the same URL. (In the “Net” tab, expand to see the request and response headers.)
Also have a look at Firebug's display of the XHTML source and associated CSS rules. (In the “HTML” tab, expand some elements to explore the markup.)
- Use the Chrome Elements Panel or a similar tool in another browser to complete the above.
-
The Linux command line tool
GET
to request these URLs:GET http://cmpt470.csil.sfu.ca/~ggbaker/3/
GET -esS http://cmpt470.csil.sfu.ca/~ggbaker/3Have a look at the output (especially of the second command) to see the information displayed.
-
The Linux command line tool
curl
to request these URLs:curl http://cmpt470.csil.sfu.ca/~ggbaker/3/
curl -I http://cmpt470.csil.sfu.ca/~ggbaker/3/
curl -I http://cmpt470.csil.sfu.ca/~ggbaker/3Have a look at the output to see the information displayed.
In your email, briefly tell us what you did.
See the Git respository setup instructions. Send the email to get your respository created. You will need to use it for the next homework.
For the technology evaluation, you will need to form groups of 2–3 people. If you have a group, email a list of the members to zju.webdev@gmail.com. If not, email and tell us. Include student numbers in the email.
Sent your results in an email to zju.webdev@gmail.com with the subject “Homework #3”. Be sure to include your student number in the body of the email.