to the main page about the tutorial  INTERACTIVE WEB SERVICES WITH JAVA back up next

HTTP - HyperText Transfer Protocol

The communication protocol of the WWW:

HTTP is stateless - interactions follow a request-response pattern with no protocol support for sessions consisting of multiple interactions between the same client and server.

A HTTP URL (Uniform Resource Locator) identifies a Web resource:
protocol://host:port/path?query
(Example: http://www.google.com/search?q=interactive+web+services)

A request from a client to a server is a TCP packet. Example:
GET /index.html HTTP/1.0
Accept: text/html, text/plain
User-Agent: Mozilla/4.76
Host: www.brics.dk
If-Modified-Since: Friday, 01-Mar-02 12:09:31 GMT

The response from the server to the client has the form:
HTTP/1.1 OK 200
Date: Mon, 08 Apr 2002 13:19:36 GMT
Server: Apache/1.3.23 (Unix) mod_bigwig/2.0 mod_perl/1.26 mod_ssl/2.8.7 OpenSSL/0.9.6c
Last-Modified: Tue, 05 Mar 2002 09:33:33 GMT
Expires: Fri, 05 Apr 2002 09:33:33 GMT
Content-Length: 3682
Content-Type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>BRICS - Basic Research in Computer Science</title></head>
<body bgcolor=white>
...
</body></html>

Request methods:

Most common response codes:

CGI (Common Gateway Interface) is a standard for making HTTP servers start programs to handle requests.

MIME (Multipurpose Internet Mail Extensions) is used to describe message encodings (e.g. Content-Type).

back COPYRIGHT © 2002-2003 ANDERS MØLLER & MICHAEL I. SCHWARTZBACH next