| java.lang.Object org.apache.commons.httpclient.HttpMethodBase org.apache.commons.httpclient.methods.HeadMethod
All known Subclasses: org.apache.commons.httpclient.NoncompliantHeadMethod,
HeadMethod | public class HeadMethod extends HttpMethodBase (Code) | | Implements the HTTP HEAD method.
The HTTP HEAD method is defined in section 9.4 of
RFC2616:
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.
author: Remy Maucherat author: Mike Bowler author: Jeff Dever author: oleg Kalnichevski version: $Revision: 480424 $ since: 1.0 |
Method Summary | |
public int | getBodyCheckTimeout() Returns non-compliant response body check timeout.
The period of time in milliseconds to wait for a response body from a non-compliant server. | public String | getName() Returns "HEAD". | protected void | readResponseBody(HttpState state, HttpConnection conn) Overrides
HttpMethodBase method to not read a response
body, despite the presence of a Content-Length or
Transfer-Encoding header.
Parameters: state - the HttpState state information associated with this method Parameters: conn - the HttpConnection connection used to executethis HTTP method throws: IOException - if an I/O (transport) error occurs. | public void | recycle() 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. | public void | setBodyCheckTimeout(int timeout) 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. |
HeadMethod | public HeadMethod()(Code) | | No-arg constructor.
since: 1.0 |
HeadMethod | public HeadMethod(String uri)(Code) | | Constructor specifying a URI.
Parameters: uri - either an absolute or relative URI since: 1.0 |
getName | public String getName()(Code) | | Returns "HEAD".
"HEAD" since: 2.0 |
recycle | public void recycle()(Code) | | 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.
See Also: HeadMethod.releaseConnection() since: 1.0 |
Methods inherited from org.apache.commons.httpclient.HttpMethodBase | public void abort()(Code)(Java Doc) protected void addCookieRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc) protected void addHostRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc) protected void addProxyConnectionHeader(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc) public void addRequestHeader(Header header)(Code)(Java Doc) public void addRequestHeader(String headerName, String headerValue)(Code)(Java Doc) protected void addRequestHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc) public void addResponseFooter(Header footer)(Code)(Java Doc) protected void addUserAgentRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc) protected void checkNotUsed() throws IllegalStateException(Code)(Java Doc) protected void checkUsed() throws IllegalStateException(Code)(Java Doc) public int execute(HttpState state, HttpConnection conn) throws HttpException, IOException(Code)(Java Doc) protected static String generateRequestLine(HttpConnection connection, String name, String requestPath, String query, String version)(Code)(Java Doc) public String getAuthenticationRealm()(Code)(Java Doc) protected String getContentCharSet(Header contentheader)(Code)(Java Doc) public boolean getDoAuthentication()(Code)(Java Doc) public HttpVersion getEffectiveVersion()(Code)(Java Doc) public boolean getFollowRedirects()(Code)(Java Doc) public AuthState getHostAuthState()(Code)(Java Doc) public HostConfiguration getHostConfiguration()(Code)(Java Doc) public MethodRetryHandler getMethodRetryHandler()(Code)(Java Doc) abstract public String getName()(Code)(Java Doc) public HttpMethodParams getParams()(Code)(Java Doc) public String getPath()(Code)(Java Doc) public AuthState getProxyAuthState()(Code)(Java Doc) public String getProxyAuthenticationRealm()(Code)(Java Doc) public String getQueryString()(Code)(Java Doc) public int getRecoverableExceptionCount()(Code)(Java Doc) public String getRequestCharSet()(Code)(Java Doc) public Header getRequestHeader(String headerName)(Code)(Java Doc) protected HeaderGroup getRequestHeaderGroup()(Code)(Java Doc) public Header[] getRequestHeaders()(Code)(Java Doc) public Header[] getRequestHeaders(String headerName)(Code)(Java Doc) public byte[] getResponseBody() throws IOException(Code)(Java Doc) public byte[] getResponseBody(int maxlen) throws IOException(Code)(Java Doc) public InputStream getResponseBodyAsStream() throws IOException(Code)(Java Doc) public String getResponseBodyAsString() throws IOException(Code)(Java Doc) public String getResponseBodyAsString(int maxlen) throws IOException(Code)(Java Doc) public String getResponseCharSet()(Code)(Java Doc) public long getResponseContentLength()(Code)(Java Doc) public Header getResponseFooter(String footerName)(Code)(Java Doc) public Header[] getResponseFooters()(Code)(Java Doc) public Header getResponseHeader(String headerName)(Code)(Java Doc) protected HeaderGroup getResponseHeaderGroup()(Code)(Java Doc) public Header[] getResponseHeaders(String headerName)(Code)(Java Doc) public Header[] getResponseHeaders()(Code)(Java Doc) protected InputStream getResponseStream()(Code)(Java Doc) protected HeaderGroup getResponseTrailerHeaderGroup()(Code)(Java Doc) public int getStatusCode()(Code)(Java Doc) public StatusLine getStatusLine()(Code)(Java Doc) public String getStatusText()(Code)(Java Doc) public URI getURI() throws URIException(Code)(Java Doc) public boolean hasBeenUsed()(Code)(Java Doc) public boolean isAborted()(Code)(Java Doc) protected boolean isConnectionCloseForced()(Code)(Java Doc) public boolean isHttp11()(Code)(Java Doc) public boolean isRequestSent()(Code)(Java Doc) public boolean isStrictMode()(Code)(Java Doc) protected void processCookieHeaders(CookieSpec parser, Header[] headers, HttpState state, HttpConnection conn)(Code)(Java Doc) protected void processResponseBody(HttpState state, HttpConnection conn)(Code)(Java Doc) protected void processResponseHeaders(HttpState state, HttpConnection conn)(Code)(Java Doc) protected void processStatusLine(HttpState state, HttpConnection conn)(Code)(Java Doc) protected void readResponse(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc) protected void readResponseBody(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc) protected void readResponseHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc) protected void readStatusLine(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc) public void recycle()(Code)(Java Doc) public void releaseConnection()(Code)(Java Doc) public void removeRequestHeader(String headerName)(Code)(Java Doc) public void removeRequestHeader(Header header)(Code)(Java Doc) protected void responseBodyConsumed()(Code)(Java Doc) protected void setConnectionCloseForced(boolean b)(Code)(Java Doc) public void setDoAuthentication(boolean doAuthentication)(Code)(Java Doc) public void setFollowRedirects(boolean followRedirects)(Code)(Java Doc) public void setHostConfiguration(HostConfiguration hostconfig)(Code)(Java Doc) public void setHttp11(boolean http11)(Code)(Java Doc) public void setMethodRetryHandler(MethodRetryHandler handler)(Code)(Java Doc) public void setParams(HttpMethodParams params)(Code)(Java Doc) public void setPath(String path)(Code)(Java Doc) public void setQueryString(String queryString)(Code)(Java Doc) public void setQueryString(NameValuePair[] params)(Code)(Java Doc) public void setRequestHeader(String headerName, String headerValue)(Code)(Java Doc) public void setRequestHeader(Header header)(Code)(Java Doc) protected void setResponseStream(InputStream responseStream)(Code)(Java Doc) public void setStrictMode(boolean strictMode)(Code)(Java Doc) public void setURI(URI uri) throws URIException(Code)(Java Doc) protected boolean shouldCloseConnection(HttpConnection conn)(Code)(Java Doc) public boolean validate()(Code)(Java Doc) protected void writeRequest(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc) protected boolean writeRequestBody(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc) protected void writeRequestHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc) protected void writeRequestLine(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc)
|
|
|