Internet Direct (Indy)
Home
PreviousUpNext
TIdEntityHeaderInfo.ContentLength Property

Indicates the size of an entity body.

Pascal
property ContentLength: Int64;

ContentLength is an Integer property that indicates the size of an entity body, as a number of octets. ContentLength reflects the transfer length of the content after any encodings specified in ContentEncoding

When ContentLength is given in a message where a message body is allowed, its field value must exactly match the number of octets in the message body. ContentLength should be avaiable whenever the message length can be determined prior to being transferred, unless this is prohibited by the HTTP protocol specification. 

For compatibility with HTTP/1.0 applications, HTTP/1.1 requests containing a message body must include a valid ContentLength header field unless the server is known to be HTTP/1.1 compliant. If a request contains a message body and ContentLength is not given, the server should respond with 400 (bad request) if it cannot determine the length of the message, or with 411 (length required) if it wishes to insist on receiving a valid ContentLength. 

All HTTP/1.1 applications that receive entities must accept "chunked" transfers that allow retrieval of HTP entities when the message length cannot be determined in advance.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.