public class HeadMethod extends HttpMethodBase
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.
| 构造器和说明 |
|---|
HeadMethod()
No-arg constructor.
|
HeadMethod(String uri)
Constructor specifying a URI.
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getBodyCheckTimeout()
已过时。
Use
HttpMethodParams |
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. |
void |
recycle()
已过时。
no longer supported and will be removed in the future
version of HttpClient
|
void |
setBodyCheckTimeout(int timeout)
已过时。
Use
HttpMethodParams |
abort, addCookieRequestHeader, addHostRequestHeader, addProxyConnectionHeader, addRequestHeader, addRequestHeader, addRequestHeaders, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, execute, generateRequestLine, getAuthenticationRealm, getContentCharSet, getDoAuthentication, getEffectiveVersion, getFollowRedirects, getHostAuthState, getHostConfiguration, getMethodRetryHandler, getParams, getPath, getProxyAuthenticationRealm, getProxyAuthState, getQueryString, getRecoverableExceptionCount, getRequestCharSet, getRequestHeader, getRequestHeaderGroup, getRequestHeaders, getRequestHeaders, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseCharSet, getResponseContentLength, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaderGroup, getResponseHeaders, getResponseHeaders, getResponseStream, getResponseTrailerHeaderGroup, getStatusCode, getStatusLine, getStatusText, getURI, hasBeenUsed, isAborted, isConnectionCloseForced, isHttp11, isRequestSent, isStrictMode, processResponseBody, processResponseHeaders, processStatusLine, readResponse, readResponseHeaders, readStatusLine, releaseConnection, removeRequestHeader, removeRequestHeader, responseBodyConsumed, setConnectionCloseForced, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setMethodRetryHandler, setParams, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setResponseStream, setStrictMode, setURI, shouldCloseConnection, validate, writeRequest, writeRequestBody, writeRequestHeaders, writeRequestLinepublic HeadMethod()
public HeadMethod(String uri)
uri - either an absolute or relative URIpublic String getName()
getName 在接口中 HttpMethodgetName 在类中 HttpMethodBasepublic void recycle()
recycle 在接口中 HttpMethodrecycle 在类中 HttpMethodBaseHttpMethodBase.releaseConnection()protected void readResponseBody(HttpState state, HttpConnection conn) throws HttpException, IOException
HttpMethodBase method to not read a response
body, despite the presence of a Content-Length or
Transfer-Encoding header.readResponseBody 在类中 HttpMethodBasestate - the state information associated with this methodconn - the connection used to execute
this HTTP methodIOException - if an I/O (transport) error occurs. Some transport exceptions
can be recovered from.HttpException - if a protocol exception occurs. Usually protocol exceptions
cannot be recovered from.HttpMethodBase.readResponse(com.ptteng.course.util.aliPayUtil.apacheCommonUtil.httpclient.HttpState, com.ptteng.course.util.aliPayUtil.apacheCommonUtil.httpclient.HttpConnection),
HttpMethodBase.processResponseBody(com.ptteng.course.util.aliPayUtil.apacheCommonUtil.httpclient.HttpState, com.ptteng.course.util.aliPayUtil.apacheCommonUtil.httpclient.HttpConnection)public int getBodyCheckTimeout()
HttpMethodParamsHttpMethodBase.getParams(),
HttpMethodParams,
HttpMethodParams.HEAD_BODY_CHECK_TIMEOUTpublic void setBodyCheckTimeout(int timeout)
HttpMethodParamstimeout - 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 checkHttpMethodBase.getParams(),
HttpMethodParams,
HttpMethodParams.HEAD_BODY_CHECK_TIMEOUTCopyright © 2017. All rights reserved.