| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.httpclient.HttpClient
public class HttpClient
 An HTTP "user-agent", containing an HTTP state and
 one or more HTTP connections, to which
 HTTP methods can be applied.
 
| Constructor Summary | |
|---|---|
| HttpClient()Creates an instance of HttpClient using default parameter set. | |
| HttpClient(HttpClientParams params)Creates an instance of HttpClient using the given parameter set. | |
| HttpClient(HttpClientParams params,
           HttpConnectionManager httpConnectionManager)Creates an instance of HttpClient with a user specified parameter setandHTTP connection manager. | |
| HttpClient(HttpConnectionManager httpConnectionManager)Creates an instance of HttpClient with a user specified HTTP connection manager. | |
| Method Summary | |
|---|---|
|  int | executeMethod(HostConfiguration hostConfiguration,
              HttpMethod method)Executes the given HTTP methodusing customhost configuration. | 
|  int | executeMethod(HostConfiguration hostconfig,
              HttpMethod method,
              HttpState state)Executes the given HTTP methodusing the given customhost configurationwith the given customHTTP state. | 
|  int | executeMethod(HttpMethod method)Executes the given HTTP method. | 
|  String | getHost()Deprecated. use #getHostConfiguration() | 
|  HostConfiguration | getHostConfiguration()Returns the host configurationassociated with the 
 HttpClient. | 
|  HttpConnectionManager | getHttpConnectionManager()Returns the HTTP connection managerassociated 
 with the HttpClient. | 
|  HttpClientParams | getParams()Returns HTTP protocol parametersassociated with this HttpClient. | 
|  int | getPort()Deprecated. use #getHostConfiguration() | 
|  HttpState | getState()Returns HTTP stateassociated with the HttpClient. | 
|  boolean | isStrictMode()Deprecated. Use DefaultHttpParams.getParameter(String)to exercise a more granular control over HTTP protocol strictness. | 
|  void | setConnectionTimeout(int newTimeoutInMilliseconds)Deprecated. Use HttpConnectionParams.setConnectionTimeout(int),HttpConnectionManager.getParams(). | 
|  void | setHostConfiguration(HostConfiguration hostConfiguration)Assigns the host configurationto use with the
 HttpClient. | 
|  void | setHttpConnectionFactoryTimeout(long timeout)Deprecated. Use HttpClientParams.setConnectionManagerTimeout(long),getParams() | 
|  void | setHttpConnectionManager(HttpConnectionManager httpConnectionManager)Assigns the HTTP connection managerto use with
 the HttpClient. | 
|  void | setParams(HttpClientParams params)Assigns HTTP protocol parametersfor this HttpClient. | 
|  void | setState(HttpState state)Assigns HTTP statefor the HttpClient. | 
|  void | setStrictMode(boolean strictMode)Deprecated. Use DefaultHttpParams.setParameter(String, Object)to exercise a more granular control over HTTP protocol strictness. | 
|  void | setTimeout(int newTimeoutInMilliseconds)Deprecated. Use HttpConnectionParams.setSoTimeout(int),HttpConnectionManager.getParams(). | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public HttpClient()
parameter set.
HttpClientParamspublic HttpClient(HttpClientParams params)
parameter set.
params - The parameters to use.HttpClientParams
public HttpClient(HttpClientParams params,
                  HttpConnectionManager httpConnectionManager)
parameter set and 
 HTTP connection manager.
params - The parameters to use.httpConnectionManager - The connection manager
 to use.public HttpClient(HttpConnectionManager httpConnectionManager)
HTTP connection manager.
httpConnectionManager - The connection manager
 to use.| Method Detail | 
|---|
public HttpState getState()
HTTP state associated with the HttpClient.
setState(HttpState)public void setState(HttpState state)
HTTP state for the HttpClient.
state - the new HTTP state for the clientgetState()public void setStrictMode(boolean strictMode)
DefaultHttpParams.setParameter(String, Object)
 to exercise a more granular control over HTTP protocol strictness.
strictMode - true for strict mode, false otherwiseisStrictMode()public boolean isStrictMode()
DefaultHttpParams.getParameter(String) 
 to exercise a more granular control over HTTP protocol strictness.
setStrictMode(boolean)public void setTimeout(int newTimeoutInMilliseconds)
HttpConnectionParams.setSoTimeout(int),
 HttpConnectionManager.getParams().
newTimeoutInMilliseconds - Timeout in millisecondspublic void setHttpConnectionFactoryTimeout(long timeout)
HttpClientParams.setConnectionManagerTimeout(long),
 getParams()
HTTP connection from the
 HTTP connection manager.
timeout - the timeout in millisecondsHttpConnectionManager.getConnection(HostConfiguration, long)public void setConnectionTimeout(int newTimeoutInMilliseconds)
HttpConnectionParams.setConnectionTimeout(int),
 HttpConnectionManager.getParams().
newTimeoutInMilliseconds - Timeout in milliseconds.HttpConnection.setConnectionTimeout(int)
public int executeMethod(HttpMethod method)
                  throws IOException,
                         HttpException
HTTP method.
method - the HTTP method to execute.
IOException - 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.
public int executeMethod(HostConfiguration hostConfiguration,
                         HttpMethod method)
                  throws IOException,
                         HttpException
HTTP method using custom 
 host configuration.
hostConfiguration - The host configuration to use.
 If null, the host configuration returned by getHostConfiguration() will be used.method - the HTTP method to execute.
IOException - 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.
public int executeMethod(HostConfiguration hostconfig,
                         HttpMethod method,
                         HttpState state)
                  throws IOException,
                         HttpException
HTTP method using the given custom 
 host configuration with the given custom 
 HTTP state.
hostconfig - The host configuration to use.
 If null, the host configuration returned by getHostConfiguration() will be used.method - the HTTP method to execute.state - the HTTP state to use when executing the method.
 If null, the state returned by getState() will be used.
IOException - 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.public String getHost()
public int getPort()
public HostConfiguration getHostConfiguration()
host configuration associated with the 
 HttpClient.
host configurationpublic void setHostConfiguration(HostConfiguration hostConfiguration)
host configuration to use with the
 HttpClient.
hostConfiguration - The host configuration to setpublic HttpConnectionManager getHttpConnectionManager()
HTTP connection manager associated 
 with the HttpClient.
HTTP connection managerpublic void setHttpConnectionManager(HttpConnectionManager httpConnectionManager)
HTTP connection manager to use with
 the HttpClient.
httpConnectionManager - The HTTP connection manager
  to setpublic HttpClientParams getParams()
HTTP protocol parameters associated with this HttpClient.
HttpClientParamspublic void setParams(HttpClientParams params)
HTTP protocol parameters for this HttpClient.
HttpClientParams| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||