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 RE: Handling HEAD method
Date Wed, 13 Sep 2006 01:01:49 GMT
OK, to avoid confusion, it appears that I actually put the
canResponseHaveBody() from the 3.x code back into my version of 2.0.2
because I needed it.  Other than that, hopefully the rest of my message
is fairly accurate :-) 

-----Original Message-----
From: Tony Thompson [mailto:Tony.Thompson@stone-ware.com] 
Sent: Tuesday, September 12, 2006 8:26 PM
To: HttpClient User Discussion
Subject: Handling HEAD method

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?

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


Mime
View raw message