ClientHttpRequestFactory implementation that uses standard JDK facilities.
java.net.HttpURLConnection , HttpComponentsClientHttpRequestFactory
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private static final int | |
| private Proxy | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ClientHttpRequest | createRequest(URI
the URI to create a request for uri, HttpMethod the HTTP method to execute httpMethod)Implements org. Create a new |
| protected HttpURLConnection | Returns: the opened connectionthe URL to open a connection to url, Proxy the proxy to use, may be proxy)nullOpens and returns a connection to the given URL. |
| protected void | prepareConnection(HttpURLConnection
the connection to prepare connection, String the HTTP request method ( httpMethod)GET, POST, etc.)Template method for preparing the given |
| public void | setBufferRequestBody(boolean bufferRequestBody)
Deprecated
for removal since 6.1. since 6.1 requests are never buffered, as if this property is
false
Indicate whether this request factory should buffer the request body internally. |
| public void | setChunkSize(int chunkSize)
Set the number of bytes to write in each chunk when not buffering request bodies locally. |
| public void | setConnectTimeout(int connectTimeout)
Set the underlying URLConnection's connect timeout (in milliseconds). |
| public void | setConnectTimeout(Duration connectTimeout)
Set the underlying URLConnection's connect timeout as |
| public void | setOutputStreaming(boolean
if output streaming is enabled outputStreaming)
Deprecated
for removal since 6.1. as of 6.1 requests are always streamed, as if this property is
true
Set if the underlying URLConnection can be set to 'output streaming' mode. |
| public void | |
| public void | |
| public void | setReadTimeout(Duration readTimeout)
Set the underlying URLConnection's read timeout (in milliseconds). |
| chunkSize | back to summary |
|---|---|
| private int chunkSize | |
| connectTimeout | back to summary |
|---|---|
| private int connectTimeout | |
| DEFAULT_CHUNK_SIZE | back to summary |
|---|---|
| private static final int DEFAULT_CHUNK_SIZE | |
| proxy | back to summary |
|---|---|
| private Proxy proxy
| |
| readTimeout | back to summary |
|---|---|
| private int readTimeout | |
| SimpleClientHttpRequestFactory | back to summary |
|---|---|
| public SimpleClientHttpRequestFactory() | |
| createRequest | back to summary |
|---|---|
| public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException Implements org. Doc from org. Create a new The returned request can be written to, and then executed by calling
| |
| openConnection | back to summary |
|---|---|
| protected HttpURLConnection openConnection(URL url, Proxy proxy) throws IOException Opens and returns a connection to the given URL. The default implementation uses the given proxy - if any - to open a connection.
| |
| prepareConnection | back to summary |
|---|---|
| protected void prepareConnection(HttpURLConnection connection, String httpMethod) throws IOException Template method for preparing the given The default implementation prepares the connection for input and output, and sets the HTTP method.
| |
| setBufferRequestBody | back to summary |
|---|---|
| public void setBufferRequestBody(boolean bufferRequestBody)
Deprecated for removal since 6.1. since 6.1 requests are never buffered, as if this property is Indicate whether this request factory should buffer the request body internally. Default is
| |
| setChunkSize | back to summary |
|---|---|
| public void setChunkSize(int chunkSize) Set the number of bytes to write in each chunk when not buffering request bodies locally. Note that this parameter is only used when
| |
| setConnectTimeout | back to summary |
|---|---|
| public void setConnectTimeout(int connectTimeout) Set the underlying URLConnection's connect timeout (in milliseconds). A timeout value of 0 specifies an infinite timeout. Default is the system's default timeout.
| |
| setConnectTimeout | back to summary |
|---|---|
| public void setConnectTimeout(Duration connectTimeout) Set the underlying URLConnection's connect timeout as Default is the system's default timeout.
| |
| setOutputStreaming | back to summary |
|---|---|
| public void setOutputStreaming(boolean outputStreaming)
Deprecated for removal since 6.1. as of 6.1 requests are always streamed, as if this property is Set if the underlying URLConnection can be set to 'output streaming' mode.
Default is When output streaming is enabled, authentication and redirection cannot be handled automatically.
If output streaming is disabled, the
| |
| setProxy | back to summary |
|---|---|
| public void setProxy(Proxy proxy) Set the | |
| setReadTimeout | back to summary |
|---|---|
| public void setReadTimeout(int readTimeout) Set the underlying URLConnection's read timeout (in milliseconds). A timeout value of 0 specifies an infinite timeout. Default is the system's default timeout.
| |
| setReadTimeout | back to summary |
|---|---|
| public void setReadTimeout(Duration readTimeout) Set the underlying URLConnection's read timeout (in milliseconds). A timeout value of 0 specifies an infinite timeout. Default is the system's default timeout.
| |