Databases Reference
In-Depth Information
In response, the web server returns an HTTP header, and then the requested resource
if the request is satisfied. Continuing the example, the server looking after http://www
.invyhome.com returns the following response:
HTTP/1.1 200 OK
Date: Wed, 02 Aug 2006 14:55:15 GMT
Server: Apache/2.2.3 (Mandriva Linux/PREFORK-1mdv2007.0)
Last-Modified: Tue, 27 Jul 2006 18:27:45 GMT
ETag: "3fc424-1e5-be72aa40"
Accept-Ranges: bytes
Content-Length: 1485
Content-Type: text/html
X-Pad: avoid browser bug
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html401/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Artists</title>
</head>
<body>
<h1>Artists</h1>
<table>
<tr>
<th>artist_id</th>
<th>artist_name</th>
</tr>
...
</table>
</body>
</html>
As with a request, the response includes the HTTP standard version, whether the re-
quest was satisfied ( 200 OK ), server details, the response type, and then the response
itself.
A key feature of HTTP is that each request and response is self-contained. You'll notice
that the request includes all the information needed to respond to the request, and the
response includes all information needed for the browser to process it. If a browser
makes subsequent requests to the same server, it will again provide all of the informa-
tion. The process is unlike traditional communications protocols where a handshak-
ing phase establishes the credentials and then communication takes place until the line
is closed. When we talk about HTTP lacking state , this is what we mean: nothing is
assumed when a browser and server communicate, each exchange is separate, and
everything is specified exhaustively each time.
Lack of state means speed. Since servers don't have to remember anything, they can
process a request and respond immediately without having to restore information
 
Search WWH ::




Custom Search