hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ROLWE...@de.ibm.com>
Subject Re: Calculation of Content Lenght by RequestEntity's getContentLength() method
Date Wed, 24 Aug 2005 06:08:52 GMT
Hello Saminda,

> Would someone pls be kind enough to tell me, if a MIME message being 
> added to POST body, and if not "chunked" and  "keep-alive" is present, 
> would getContentLength() give the correct "Content-Lenght".

The request entity does not know of the presence of a chunked encoding.
It determines the content length based on the data you put into the
request entity, and it returns -1 (or something like that) if it can
not determine the content length. In that case, chunked encoding will
be chosen by the POST method.
If the request entity is able to compute the content length, then
RE.getContentLength will return it. If the request entity is unable
to compute the content length, there is no way you can force it.

> I heard that 
> this method would return if the body is String. Pls acknowledge.

Sorry, you lost me there. If only strings are contained in the request
entity, then it should be able to compute the content length. Is that
what you meant?

hope that helps,
  Roland


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org


Mime
View raw message