org.apache.commons.httpclient.methods
Class HeadMethod
java.lang.Object
|
+--org.apache.commons.httpclient.HttpMethodBase
|
+--org.apache.commons.httpclient.methods.HeadMethod
- Direct Known Subclasses:
- UrlHeadMethod
- public class HeadMethod
- extends HttpMethodBase
Implements the HTTP HEAD specification.
The HTTP HEAD method is defined in section 8.2 of
RFC1945:
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.
- Since:
- 1.0
- Version:
- $Revision: 1.17 $
- Author:
- Remy Maucherat, Mike Bowler, Jeff Dever
Methods inherited from class org.apache.commons.httpclient.HttpMethodBase |
addAuthorizationRequestHeader,
addContentLengthRequestHeader,
addCookieRequestHeader,
addHostRequestHeader,
addProxyAuthorizationRequestHeader,
addRequestHeader,
addRequestHeader,
addRequestHeaders,
addResponseFooter,
addUserAgentRequestHeader,
checkNotUsed,
checkUsed,
execute,
generateRequestLine,
getContentCharSet,
getDoAuthentication,
getFollowRedirects,
getHostConfiguration,
getPath,
getQueryString,
getRecoverableExceptionCount,
getRequestCharSet,
getRequestContentLength,
getRequestHeader,
getRequestHeaderGroup,
getRequestHeaders,
getResponseBody,
getResponseBodyAsStream,
getResponseBodyAsString,
getResponseCharSet,
getResponseFooter,
getResponseFooters,
getResponseHeader,
getResponseHeaderGroup,
getResponseHeaders,
getResponseTrailerHeaderGroup,
getStatusCode,
getStatusLine,
getStatusText,
getURI,
hasBeenUsed,
isHttp11,
isStrictMode,
processResponseBody,
processResponseHeaders,
processStatusLine,
readResponse,
readResponseHeaders,
readStatusLine,
releaseConnection,
removeRequestHeader,
responseBodyConsumed,
setDoAuthentication,
setFollowRedirects,
setHostConfiguration,
setHttp11,
setPath,
setQueryString,
setQueryString,
setRequestHeader,
setRequestHeader,
setResponseStream,
setStrictMode,
shouldCloseConnection,
validate,
writeRequest,
writeRequestBody,
writeRequestHeaders,
writeRequestLine |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
HeadMethod
public HeadMethod()
- No-arg constructor.
- Since:
- 1.0
HeadMethod
public HeadMethod(String uri)
- Constructor specifying a URI.
- Parameters:
uri
- either an absolute or relative URI- Since:
- 1.0
getName
public String getName()
- Returns "HEAD".
- Overrides:
- getName in class HttpMethodBase
- Returns:
- "HEAD"
- Since:
- 2.0
recycle
public void recycle()
- Override recycle to reset redirects default.
- Overrides:
- recycle in class HttpMethodBase
- Since:
- 1.0
readResponseBody
protected void readResponseBody(HttpState state,
HttpConnection conn)
throws IOException
- Overrides
HttpMethodBase
method to not read a response
body, despite the presence of a Content-Length or
Transfer-Encoding header.
- Overrides:
- readResponseBody in class HttpMethodBase
- Parameters:
state
- shared http stateconn
- the http connection to read from- Throws:
- IOException - when there's an error reading data
- Since:
- 2.0
Copyright (c) 1999-2002 - Apache Software Foundation