hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ROLWE...@de.ibm.com>
Subject Re: Problems displaying a PNG graphics file
Date Fri, 22 Jul 2005 06:33:03 GMT
Hello Manohar,

> request my packet sniffer seems to always record a "Content-Length :0" 
being 
> sent over the network!!

That is indeed a problem. You did not forget to add some data to your 
request?
That would be the most simple explanation.

> Therefore I was wondering if there was a way of 
> manually 
> setting the Content-Length after calculation. I shall try disabling the 
> expect-continue handshake + passing in a HttpState object. 
> How come the Content-Length is not getting calculated automatically when 
i "
> POST.execute_method" ?

There are situations when the length of the request body can not be 
determined
at all, for example if the data is provided as a stream. The preferred 
method
for HTTP/1.1 is to use chunked encoding instead of a content-length 
header.
If that is not possible or disabled, then HttpClient will get the content 
length
from the request entity and add the content-length header.

Since you are seeing a content-length header, it looks as if HttpClient 
did
not decide to use the chunked encoding. And since the value of the 
content-length
header is 0, it looks as if your PostMethod was not given anything to 
post.

hope that helps,
  Roland


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


Mime
View raw message