|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 set and
HTTP 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 method using custom
host configuration . |
int |
executeMethod(HostConfiguration hostconfig,
HttpMethod method,
HttpState state)
Executes the given HTTP method using the given custom
host configuration with the given custom
HTTP state . |
int |
executeMethod(HttpMethod method)
Executes the given HTTP method . |
HostConfiguration |
getHostConfiguration()
Returns the host configuration associated with the
HttpClient. |
HttpConnectionManager |
getHttpConnectionManager()
Returns the HTTP connection manager associated
with the HttpClient. |
HttpClientParams |
getParams()
Returns HTTP protocol parameters associated with this HttpClient. |
HttpState |
getState()
Returns HTTP state associated with the HttpClient. |
void |
setHostConfiguration(HostConfiguration hostConfiguration)
Assigns the host configuration to use with the
HttpClient. |
void |
setHttpConnectionManager(HttpConnectionManager httpConnectionManager)
Assigns the HTTP connection manager to use with
the HttpClient. |
void |
setParams(HttpClientParams params)
Assigns HTTP protocol parameters for this HttpClient. |
void |
setState(HttpState state)
Assigns HTTP state for the HttpClient. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpClient()
parameter set
.
HttpClientParams
public 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 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.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.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 instead.
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 HostConfiguration getHostConfiguration()
host configuration
associated with the
HttpClient.
host configuration
public 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 manager
public 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.
HttpClientParams
public void setParams(HttpClientParams params)
HTTP protocol parameters
for this HttpClient.
params
- params to set. Cannot be null
HttpClientParams
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |