org.apache.commons.httpclient
Class ConnectMethod
java.lang.Object
|
+--org.apache.commons.httpclient.HttpMethodBase
|
+--org.apache.commons.httpclient.ConnectMethod
- public class ConnectMethod
- extends HttpMethodBase
Wraps another method to tunnel through a proxy.
- Since:
- 2.0
- Version:
- $Revision: 1.7 $ $Date: 2003/01/28 04:40:20 $
- Author:
- Ortwin Glück, dIon Gillard, Mike Bowler
Field Summary |
static String |
NAME
the name of this method |
Methods inherited from class org.apache.commons.httpclient.HttpMethodBase |
addAuthorizationRequestHeader,
addContentLengthRequestHeader,
addCookieRequestHeader,
addHostRequestHeader,
addProxyAuthorizationRequestHeader,
addRequestHeader,
addRequestHeader,
addRequestHeaders,
addResponseFooter,
addUserAgentRequestHeader,
checkNotUsed,
checkUsed,
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,
readResponseBody,
readResponseHeaders,
readStatusLine,
recycle,
releaseConnection,
removeRequestHeader,
responseBodyConsumed,
setDoAuthentication,
setFollowRedirects,
setHostConfiguration,
setHttp11,
setPath,
setQueryString,
setQueryString,
setRequestHeader,
setRequestHeader,
setResponseStream,
setStrictMode,
shouldCloseConnection,
validate,
writeRequest,
writeRequestBody |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
NAME
public static final String NAME
- the name of this method
ConnectMethod
public ConnectMethod(HttpMethod method)
- Create a connect method wrapping the existing method
- Parameters:
method
- the method
to execute after connecting
to the server
getName
public String getName()
- Provide the
name
of this method.
- Overrides:
- getName in class HttpMethodBase
- Returns:
- the String "CONNECT"
execute
public int execute(HttpState state,
HttpConnection conn)
throws IOException,
HttpException
- Execute this method by tunnelling and then executing the wrapped method.
- Overrides:
- execute in class HttpMethodBase
- Parameters:
state
- the current http stateconn
- the connection to write to- Returns:
- the http status code from execution
- Throws:
- HttpException - when an error occurs writing the headers
- IOException - when an error occurs writing the headers
writeRequestHeaders
protected void writeRequestHeaders(HttpState state,
HttpConnection conn)
throws HttpException,
IOException
- Writes a minimal set of headers to the proxy.
- Overrides:
- writeRequestHeaders in class HttpMethodBase
- Parameters:
state
- the current http stateconn
- the connection to write to- Throws:
- HttpException - when an error occurs writing the headers
- IOException - when an error occurs writing the headers
writeRequestLine
protected void writeRequestLine(HttpState state,
HttpConnection conn)
throws IOException,
HttpException
- Special Connect request.
- Overrides:
- writeRequestLine in class HttpMethodBase
- Parameters:
state
- the current http stateconn
- the connection to write to- Throws:
- IOException - when an error occurs writing the request
- HttpException - when an error occurs writing the request
Copyright (c) 1999-2002 - Apache Software Foundation