HTTP Protocol : The Answer


The HTTP answer is sent to the browser by the server. It contains :

- A status line:
It specifies the protocol version which is used and the processing state with a code.

- The request header field:
It's optional lines which allow to give information about the answer and the server.

Header name Description
Content-Encoding Coding type of the answer body
Content-Language Language type of the answer body
Content-Length Length of the answer body
Content-Type Content type of the answer body
Date beginning date of the data transfer
Expires Expiration of data date
Forwarded Used by intermediate machines between browser and server
Location Redirection to a new URL
Server Characteristics of the server which has sent the answer

- The answer body :
It contains the requested document.


To summarize, this is the form of an HTTP request :
VERSION-HTTP CODE
HEADER : Value
EMPTY LINE
ANSWER BODY

And here is an example of an HTTP answer
HTTP/1.1 200 OK
Date : Sat, 15 Jan 2000 14:37:12 GMT
Server : Microsoft-IIS/2.0
Content-Type : text/HTML
Content-Lentgh : 6
Last-Modified : Fri, 14 Jan 2000 08:25:13 GMT
empty line
Hello!