Exercise HTTP


Solution

Generate your first requests

Connect (using telnet on the port 80) the server www.benoist.ch. Write a request for the resource coursWebProgramming/ , the answer must have the status 200. If the status is not 200, try again.
 
Write a small PHP containing a form with one field (username), and displaying the variable sent by this form of this form ("Hello $_REQUEST['username']"); you can also use the following PHP file: http-exercise-form.php
Connect your localhost web-site (telnet port 80) and send a request for using a GET method for your page containing a username.
Connect your web-site and send a request for using a POST method for your page containing a username. YOu have to insert a content-length header (do not forget to count the content before sending it).
Connect the google web-site and send a request for "HTTP Tutorial" using a GET method. You have to URL encode your request.

Monitor HTTP trafic

Install Firefox Add-on for web developpers: Firebug for analyzing http header in requests and responses. Start to trace HTTP headers.
Monitor the trafic with your php script.
Connect to the page http://staff.ti.bfh.ch/bie1. Count the number of requests (just for the page itself, not for images or css) and try to understand what appends.
Count the number of requests for the site of the "20 Minutes" : 20minuten.ch. Take a closer look at the requests whose answer was a 302. What is it for?