Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.commons.httpclient.HttpMethodBase
org.apache.commons.httpclient.methods.HeadMethod
public class HeadMethod
extends HttpMethodBase
The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request. This method can be used for obtaining metainformation about the entity implied by the request without transferring the entity-body itself. This method is often used for testing hypertext links for validity, accessibility, and recent modification.
Constructor Summary | |
| |
|
Method Summary | |
int |
|
String |
|
protected void |
|
void |
|
void |
|
public HeadMethod()
No-arg constructor.
- Since:
- 1.0
public HeadMethod(String uri)
Constructor specifying a URI.
- Parameters:
uri
- either an absolute or relative URI
- Since:
- 1.0
public int getBodyCheckTimeout()
Deprecated. Use
HttpMethodParams
Returns non-compliant response body check timeout.
- Returns:
- The period of time in milliseconds to wait for a response body from a non-compliant server. -1 returned when non-compliant response body check is disabled
public String getName()
Returns "HEAD".
- Specified by:
- getName in interface HttpMethod
- Overrides:
- getName in interface HttpMethodBase
- Returns:
- "HEAD"
- Since:
- 2.0
protected void readResponseBody(HttpState state, HttpConnection conn) throws HttpException, IOException
OverridesHttpMethodBase
method to not read a response body, despite the presence of a Content-Length or Transfer-Encoding header.
- Overrides:
- readResponseBody in interface HttpMethodBase
- Parameters:
state
- thestate
information associated with this methodconn
- theconnection
used to execute this HTTP method
- Throws:
HttpException
- if a protocol exception occurs. Usually protocol exceptions cannot be recovered from.
- Since:
- 2.0
- See Also:
HeadMethod
,HeadMethod
public void recycle()
Deprecated. no longer supported and will be removed in the future version of HttpClient
Recycles the HTTP method so that it can be used again. Note that all of the instance variables will be reset once this method has been called. This method will also release the connection being used by this HTTP method.
- Specified by:
- recycle in interface HttpMethod
- Overrides:
- recycle in interface HttpMethodBase
- Since:
- 1.0
- See Also:
releaseConnection()
public void setBodyCheckTimeout(int timeout)
Deprecated. Use
HttpMethodParams
Sets non-compliant response body check timeout.
- Parameters:
timeout
- The period of time in milliseconds to wait for a response body from a non-compliant server. -1 can be used to disable non-compliant response body check