Http Response
Web Client and Server dialogue.
The HTTP response
-
The Response data contains a header as the first part and a body with
the html tags to be handled by a web browser
Example of a HTTP response header
1 2 3 4 5 6 7 8 9
HTTP/1.1 200 OK Date: Mon, 06 Dec 1999 20:54:26 GMT Server: Apache/1.3.6 (Unix) Last-Modified: Fri, 04 Oct 1996 14:06:11 GMT ETag: "2f5cd-964-381e1bd6" Accept-Ranges: bytes Content-length: 327 Connection: close Content-type: text/html
- The first line, HTTP/1.1 200 OK, tells the HTTP protocol the server uses, returns status code of 200 and the status message OK.
- The second line indicates the current date on the server. The time is expressed in Greenwich Mean Time (GMT).
- The third line tells the client what kind of software the server is running . In this case, the server is Apache version 1.3.6 on Unix.
- The fourth line specifies the most recent modification time of the document requested by the client.
- The fifth line indicates an entity tag. This provides the web client with a unique identifier for the server resource.
- The sixth line indicates to the browser that the server processes the ability to return subsections of a document, instead of returning the entire document every time it is requested.
- The seventh line tells the client how many bytes are in the entity body that follow the headers.
- The eighth line indicates that the connection will close after the server's response.
- The ninth line (Content-type) tells the browser what kind of document the server is including in its response. In this case, it's HTML
Example of a HTTP reponse body<HTML> <HEAD><TITLE>Joe's Tools</TITLE></HEAD> <BODY> <H1>Tools Page</H1> <H2>Hammers</H2> <P>Joe's Hardware Online has the largest selection of <A HREF="./hammers.html">hammers</A> on the earth.</P> <H2><A NAME=drills></A>Drills</H2> <P>Joe's Hardware has a complete line of cordless and corded drills, as well as the latest in plutonium-powered atomic drills, for those big around the house jobs.</P> ... </BODY> </HTML>