Hyper Text Transfer Protocol

November 17th, 2002

Therry Coulbois



Introduction:

HTTP is a very simple application protocole, with mainly two commands GET and POST that are very similar. It works over TCP using port 80, following a Client-Server model, the commands go from the client to the server which answers either by errors or by datas. Datas are files headed by a "Content/Type" line. Commands are written in plain text, one by line and begin by GET or POST. Very commonly, HTTP is used to browse through HTML documents. Please read RFC 2616 and specially paragraph 5, which is the current standard for details.



HTTP at work:

On a Unix machine use Telnet to see HTTP at work. Telnet is another application protocole used to connect to a remote machine when port 22 is specified. When another port is specified (here 80), it behaves like an application interface to use a TCP connection (a socket). Everything you type on the keyboard is transmitted on the connection, and every received data is shown on the output.

  1. Connect to a web server
    > telnet www.logique.jussieu.fr:80
  2. try to get an HTML document
    > GET index.html
  3. Generate different kind of errors
  4. Carefully note the first line (Content/Type)



HTML:

Hyper Text Marked-Up Language is a language to specify the presentation of a document on a computer. You should already know it as it is so widely spread, if no look at the source code of some HTML documents (for example this one). You can have a look to The HTML Specification as given by the W3 Consortium (or check your favorite HTML book).

CGI:

Although depracated since the use of Java Servlets (JSP) and PHP, you should know what are the basic concepts behind a Common Gateway Interface. Be sure that you are able to write a CGI that prints the number of times a document has been accessed. This require to be allowed to write CGI scripts by your webmaster.

CGI and HTML forms:

This is still a popular way to make interactive web-pages. This is also something you should know. You can have a look to the Quizz I wrote for my freshmen, although I did not bother writing a CGI to get the results of the Quizz, using e-mail instead and a hand treatment (one always should think about the benefit of writing complicated codes with respect to performing a hand treatment...).