March 2003
Intermediate to advanced
312 pages
7h 12m
English
The Content-Length header simply indicates the length of the content section of the HTTP message in bytes. An example of this header is given in the following HTTP response:
HTTP/1.1 200 OK Date: Tue, 21 May 2002 12:34:56 GMT Content-Type: text/html Content-Length: 102 <html> <head> <title>Content-Length Example</title> </head> <body> Content-Length: 102 </body> </html>
In this example, the number of bytes between the first character of the content (the < of <html>) and the final character of the content (the > of </html>) inclusively is 102.
As I briefly mentioned in the discussion of the Connection general header, the Content-Length header is necessary when persistent connections are being used (and content is expected) in ...
Read now
Unlock full access