java.lang.Object | |
↳ | org.springframework.http.client.SimpleClientHttpRequestFactory |
ClientHttpRequestFactory
implementation that uses standard J2SE facilities.
CommonsClientHttpRequestFactory
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new
ClientHttpRequest for the specified URI and HTTP method. | |||||||||||
Indicates whether this request factory should buffer the
request body
internally. | |||||||||||
Sets the number of bytes to write in each chunk when not buffering request bodies locally.
| |||||||||||
Sets the
Proxy to use for this request factory. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Opens and returns a connection to the given URL.
| |||||||||||
Template method for preparing the given
HttpURLConnection . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.http.client.ClientHttpRequestFactory
|
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 |
---|
Indicates whether this request factory should buffer the request body
internally.
Default is true
. When sending large amounts of data via POST or PUT, it is recommended to change this
property to false
, so as not to run out of memory. This will result in a ClientHttpRequest
that either streams directly to the underlying HttpURLConnection (if the
Content-Length
is known in advance), or that will
use "Chunked transfer encoding" (if the Content-Length
is not known in advance).
Sets the number of bytes to write in each chunk when not buffering request bodies locally.
Note that this parameter is only used when bufferRequestBody
is set
to false
, and the Content-Length
is not known in advance.
Opens and returns a connection to the given URL.
The default implementation uses the given proxy
- if any - to open a connection.
url | the URL to open a connection to |
---|---|
proxy | the proxy to use, may be null |
IOException | in case of I/O errors |
---|
Template method for preparing the given HttpURLConnection
.
The default implementation prepares the connection for input and output, and sets the HTTP method.
connection | the connection to prepare |
---|---|
httpMethod | the HTTP request method (GET , POST , etc.) |
IOException | in case of I/O errors |
---|