java.lang.Object | |
↳ | org.springframework.http.client.CommonsClientHttpRequestFactory |
ClientHttpRequestFactory
implementation that uses
Jakarta Commons HttpClient to create requests.
Allows to use a pre-configured HttpClient instance - potentially with authentication, HTTP connection pooling, etc.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new instance of the
CommonsHttpRequestFactory with a default
HttpClient that uses a default MultiThreadedHttpConnectionManager. | |||||||||||
Create a new instance of the
CommonsHttpRequestFactory with the given
HttpClient instance. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new
ClientHttpRequest for the specified URI and HTTP method. | |||||||||||
Shutdown hook that closes the underlying HttpConnectionManager's
connection pool, if any.
| |||||||||||
Return the
HttpClient used by this factory. | |||||||||||
Set the
HttpClient used by this factory. | |||||||||||
Set the socket read timeout for the underlying HttpClient.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a Commons HttpMethodBase object for the given HTTP method
and URI specification.
| |||||||||||
Template method that allows for manipulating the org.apache.commons.httpclient.HttpMethodBase
before it is returned as part of a CommonsClientHttpRequest.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.factory.DisposableBean
| |||||||||||
From interface
org.springframework.http.client.ClientHttpRequestFactory
|
Create a new instance of the CommonsHttpRequestFactory
with a default
HttpClient that uses a default MultiThreadedHttpConnectionManager.
Create a new instance of the CommonsHttpRequestFactory
with the given
HttpClient instance.
httpClient | the HttpClient instance to use for this factory |
---|
Create a new ClientHttpRequest
for the specified URI and HTTP method.
The returned request can be written to, and then executed by calling
execute()
.
uri | the URI to create a request for |
---|---|
httpMethod | the HTTP method to execute |
IOException |
---|
Shutdown hook that closes the underlying HttpConnectionManager's connection pool, if any.
Return the HttpClient
used by this factory.
Set the HttpClient
used by this factory.
Set the socket read timeout for the underlying HttpClient. A value of 0 means never timeout.
timeout | the timeout value in milliseconds |
---|
Create a Commons HttpMethodBase object for the given HTTP method and URI specification.
httpMethod | the HTTP method |
---|---|
uri | the URI |
Template method that allows for manipulating the org.apache.commons.httpclient.HttpMethodBase before it is returned as part of a CommonsClientHttpRequest.
The default implementation is empty.
httpMethod | the Commons HTTP method object to process |
---|