hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saminda Abeyruwan <sami...@opensource.lk>
Subject Re: Calculation of Content Lenght by RequestEntity's getContentLength() method
Date Wed, 24 Aug 2005 07:06:21 GMT
Hi Roland,

Thanx for the quike reply. Let assume i'm sending a MTOM message in 
POST. When chunking is -1, i am forced to give "Content-Length" header 
parameter value, if "keep-alive" is ON. In that case Request Entity 
calls xxx.getContentLenght(). Would this content-length value be 
correct, if MTOM message is contain 1 Mb of data.

Saminda

Roland Weber wrote:

>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
>
>
>
>  
>


---------------------------------------------------------------------
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