You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Tony Thompson <to...@stone-ware.com> on 2005/04/01 15:13:03 UTC

304 handling

Can anyone comment on how the HTTPClient would handle a 304 response
from a web server that also contains a Content-Length header set to
something other than 0?  I am using the HTTPClient to connect to the
same application on 2 different versions of IBM WebSphere; one is slow,
the other is fast.

The only difference I can see is when the slow one attempts to load
graphics and a 304 is returned, a Content-Length header is also set to
something other than 0 (which is not valid).  When the faster server
returns a 304 response for the same request, it always has a
Content-Length: 0 header.  A browser going directly to the server seems
to handle the bad 304 response without any issue.

Thanks for any input.
Tony

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


Re: 304 handling

Posted by Oleg Kalnichevski <ol...@apache.org>.
Tony

HttpClient does not attempt to automatically handle 304 redirect
request. See
<http://jakarta.apache.org/commons/httpclient/3.0/redirects.html> for
details.

Invalid Content-Length will not matter IF the server closes the
connection. HttpClient will detect the end of stream condition and
terminate properly. If the server for whatever reason keeps the
connection alive HttpClient will block waiting for input or a socket
timeout.

Hope this helps

Oleg

On Fri, Apr 01, 2005 at 08:13:03AM -0500, Tony Thompson wrote:
> Can anyone comment on how the HTTPClient would handle a 304 response
> from a web server that also contains a Content-Length header set to
> something other than 0?  I am using the HTTPClient to connect to the
> same application on 2 different versions of IBM WebSphere; one is slow,
> the other is fast.
> 
> The only difference I can see is when the slow one attempts to load
> graphics and a 304 is returned, a Content-Length header is also set to
> something other than 0 (which is not valid).  When the faster server
> returns a 304 response for the same request, it always has a
> Content-Length: 0 header.  A browser going directly to the server seems
> to handle the bad 304 response without any issue.
> 
> Thanks for any input.
> Tony
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 

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