remm 01/06/20 08:58:17 Modified: httpclient/src/java/org/apache/commons/httpclient HttpMethod.java HttpMethodBase.java Log: - Add new hasResponseBody boolean flag, which can be used to indicate that the response won't have a body, regardless of what the headers indicate. This allows a clean handling of HEAD, and allows creating other HEAD-like methods. Revision Changes Path 1.3 +11 -3 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethod.java Index: HttpMethod.java =================================================================== RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethod.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- HttpMethod.java 2001/05/21 19:59:50 1.2 +++ HttpMethod.java 2001/06/20 15:58:13 1.3 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethod.java,v 1.2 2001/05/21 19:59:50 rwaldhoff Exp $ - * $Revision: 1.2 $ - * $Date: 2001/05/21 19:59:50 $ + * $Header: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethod.java,v 1.3 2001/06/20 15:58:13 remm Exp $ + * $Revision: 1.3 $ + * $Date: 2001/06/20 15:58:13 $ * * ==================================================================== * @@ -333,6 +333,14 @@ * @return true if a content-length header will be expected by the server */ public boolean needContentLength(); + + + /** + * Return true if the method's response is expected to have a body. + * + * @return true if a response body should be expected by the client + */ + public boolean hasResponseBody(); /** 1.5 +13 -3 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java Index: HttpMethodBase.java =================================================================== RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- HttpMethodBase.java 2001/05/21 19:59:48 1.4 +++ HttpMethodBase.java 2001/06/20 15:58:14 1.5 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v 1.4 2001/05/21 19:59:48 rwaldhoff Exp $ - * $Revision: 1.4 $ - * $Date: 2001/05/21 19:59:48 $ + * $Header: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v 1.5 2001/06/20 15:58:14 remm Exp $ + * $Revision: 1.5 $ + * $Date: 2001/06/20 15:58:14 $ * * ==================================================================== * @@ -560,6 +560,16 @@ * @return true if a content-length header will be expected by the server */ public boolean needContentLength() { + return true; + } + + + /** + * Return true if the method's response is expected to have a body. + * + * @return true if a response body should be expected by the client + */ + public boolean hasResponseBody() { return true; }