public class ConnectMethod extends HttpMethodBase
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
NAME
the name of this method
|
effectiveVersion, statusLine| 构造器和说明 |
|---|
ConnectMethod()
已过时。
use #ConnectMethod(HttpHost);
Create a connect method.
|
ConnectMethod(HostConfiguration targethost)
Create a connect method.
|
ConnectMethod(HttpMethod method)
已过时。
the wrapped method is no longer used
Create a connect method wrapping the existing method
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
addCookieRequestHeader(HttpState state,
HttpConnection conn)
This method does nothing.
|
protected void |
addRequestHeaders(HttpState state,
HttpConnection conn)
Populates the request headers map to with additional
headers to be submitted to the given HttpConnection. |
int |
execute(HttpState state,
HttpConnection conn)
Execute this method and create a tunneled HttpConnection.
|
java.lang.String |
getName()
Provide the
name of this method. |
java.lang.String |
getPath()
Gets the path of this HTTP method.
|
URI |
getURI()
Returns the URI of the HTTP method
|
protected boolean |
shouldCloseConnection(HttpConnection conn)
Returns
true if the status code is anything extension than
SC_OK, false otherwise. |
protected void |
writeRequestLine(HttpState state,
HttpConnection conn)
Special Connect request.
|
abort, addHostRequestHeader, addProxyConnectionHeader, addRequestHeader, addRequestHeader, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, generateRequestLine, getAuthenticationRealm, getContentCharSet, getDoAuthentication, getEffectiveVersion, getFollowRedirects, getHostAuthState, getHostConfiguration, getMethodRetryHandler, getParams, getProxyAuthenticationRealm, getProxyAuthState, getQueryString, getRecoverableExceptionCount, getRequestCharSet, getRequestHeader, getRequestHeaderGroup, getRequestHeaders, getRequestHeaders, getResponseBody, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseBodyAsString, getResponseCharSet, getResponseContentLength, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaderGroup, getResponseHeaders, getResponseHeaders, getResponseStream, getResponseTrailerHeaderGroup, getStatusCode, getStatusLine, getStatusText, hasBeenUsed, isAborted, isConnectionCloseForced, isHttp11, isRequestSent, isStrictMode, processCookieHeaders, processResponseBody, processResponseHeaders, processStatusLine, readResponse, readResponseBody, readResponseHeaders, readStatusLine, recycle, releaseConnection, removeRequestHeader, removeRequestHeader, responseBodyConsumed, setConnectionCloseForced, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setMethodRetryHandler, setParams, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setResponseStream, setStrictMode, setURI, validate, writeRequest, writeRequestBody, writeRequestHeaderspublic static final java.lang.String NAME
public ConnectMethod()
public ConnectMethod(HttpMethod method)
method - the method to execute after connecting
to the serverpublic ConnectMethod(HostConfiguration targethost)
public java.lang.String getName()
name of this method.getName 在接口中 HttpMethodgetName 在类中 HttpMethodBasepublic java.lang.String getPath()
HttpMethodBasegetPath 在接口中 HttpMethodgetPath 在类中 HttpMethodBasepublic URI getURI() throws URIException
HttpMethodBasegetURI 在接口中 HttpMethodgetURI 在类中 HttpMethodBaseURIException - If the URI cannot be created.HttpMethod.getURI()protected void addCookieRequestHeader(HttpState state, HttpConnection conn) throws java.io.IOException, HttpException
addCookieRequestHeader 在类中 HttpMethodBasestate - current state of http requestsconn - the connection to use for I/Ojava.io.IOException - when errors occur reading or writing to/from the
connectionHttpException - when a recoverable error occursHttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection)protected void addRequestHeaders(HttpState state, HttpConnection conn) throws java.io.IOException, HttpException
headers to be submitted to the given HttpConnection.
This implementation adds User-Agent, Host, and Proxy-Authorization headers, when appropriate.
addRequestHeaders 在类中 HttpMethodBasestate - the client stateconn - the HttpConnection the headers will eventually be
written tojava.io.IOException - when an error occurs writing the requestHttpException - when a HTTP protocol error occursHttpMethodBase.writeRequestHeaders(depends.org.apache.commons.httpclient.HttpState, depends.org.apache.commons.httpclient.HttpConnection)public int execute(HttpState state, HttpConnection conn) throws java.io.IOException, HttpException
execute 在接口中 HttpMethodexecute 在类中 HttpMethodBasestate - the current http stateconn - the connection to write toHttpException - when an error occurs writing the headersjava.io.IOException - when an error occurs writing the headersHttpConnection.tunnelCreated()protected void writeRequestLine(HttpState state, HttpConnection conn) throws java.io.IOException, HttpException
writeRequestLine 在类中 HttpMethodBasestate - the current http stateconn - the connection to write tojava.io.IOException - when an error occurs writing the requestHttpException - when an error occurs writing the requestHttpMethodBase.generateRequestLine(depends.org.apache.commons.httpclient.HttpConnection, java.lang.String, java.lang.String, java.lang.String, java.lang.String)protected boolean shouldCloseConnection(HttpConnection conn)
true if the status code is anything extension than
SC_OK, false otherwise.shouldCloseConnection 在类中 HttpMethodBaseconn - the connection in questiontrue if the connection should be closedHttpMethodBase.shouldCloseConnection(HttpConnection),
HttpStatus.SC_OK