hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Thompson" <Tony.Thomp...@stone-ware.com>
Subject Handling HEAD method
Date Wed, 13 Sep 2006 00:25:38 GMT
I am still back on the 2.0.2 version of the client (I will get up to 3
soon) but I am having an issue that I need to know how to best patch for
now and also to make sure it is not an issue in the 3.x code.  I am
using a method that does a HEAD request (derived from GetMethod).  The
RFC states that the HEAD response MUST NOT include a response body.  The
issue is, the Content-Length header is set so the HTTPClient thinks
there should be content coming.  So, it sits and waits for the server to
send content.  In the 2.0.2 client, a method was added to deal with
various responses that should not have a response body,
canResponseHaveBody().  I think to patch this up for my situation, I
will fix readResponseBody() so that it also checks if the method is HEAD
and then assumes no body allowed.  I thought about fixing this in my
derived class but, I don't really want to override all of readResponse()
just to get it to ignore HEAD responses.

If this makes sense to have in the HTTPClient code, can the 3.x code be
fixed so that it also enforces the requirement that a HEAD response will
not have a body?

This message (and any associated files) is intended only for the 
use of the individual or entity to which it is addressed and may 
contain information that is confidential, subject to copyright or
constitutes a trade secret. If you are not the intended recipient 
you are hereby notified that any dissemination, copying or 
distribution of this message, or files associated with this message, 
is strictly prohibited. If you have received this message in error, 
please notify us immediately by replying to the message and deleting 
it from your computer. Messages sent to and from Stoneware, Inc.
may be monitored.

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

View raw message