类 JdkClientHttpRequestFactory
java.lang.Object
cn.taketoday.http.client.JdkClientHttpRequestFactory
- 所有已实现的接口:
ClientHttpRequestFactory
ClientHttpRequestFactory implementation based on the Java
HttpClient.- 从以下版本开始:
- 4.0
- 作者:
- Marten Deinum, Arjen Poutsma, Harry Yang
-
字段概要
字段 -
构造器概要
构造器构造器说明Create a new instance of theJdkClientHttpRequestFactorywith a defaultHttpClient.JdkClientHttpRequestFactory(HttpClient httpClient) Create a new instance of theJdkClientHttpRequestFactorybased on the givenHttpClient.JdkClientHttpRequestFactory(HttpClient httpClient, Executor executor) Create a new instance of theJdkClientHttpRequestFactorybased on the givenHttpClientandExecutor. -
方法概要
修饰符和类型方法说明createRequest(URI uri, HttpMethod httpMethod) Create a newClientHttpRequestfor the specified URI and HTTP method.voidsetReadTimeout(int readTimeout) Set the underlyingHttpClient's read timeout (in milliseconds).voidsetReadTimeout(Duration readTimeout) Set the underlyingHttpClient's read timeout as aDuration.
-
字段详细资料
-
httpClient
-
executor
-
readTimeout
-
-
构造器详细资料
-
JdkClientHttpRequestFactory
public JdkClientHttpRequestFactory()Create a new instance of theJdkClientHttpRequestFactorywith a defaultHttpClient. -
JdkClientHttpRequestFactory
Create a new instance of theJdkClientHttpRequestFactorybased on the givenHttpClient.- 参数:
httpClient- the client to base on
-
JdkClientHttpRequestFactory
Create a new instance of theJdkClientHttpRequestFactorybased on the givenHttpClientandExecutor.- 参数:
httpClient- the client to base onexecutor- the executor to use for blocking write operations
-
-
方法详细资料
-
setReadTimeout
public void setReadTimeout(int readTimeout) Set the underlyingHttpClient's read timeout (in milliseconds). A timeout value of 0 specifies an infinite timeout.Default is the system's default timeout.
-
setReadTimeout
Set the underlyingHttpClient's read timeout as aDuration.Default is the system's default timeout.
-
createRequest
从接口复制的说明:ClientHttpRequestFactoryCreate a newClientHttpRequestfor the specified URI and HTTP method.The returned request can be written to, and then executed by calling
ClientHttpRequest.execute().- 指定者:
createRequest在接口中ClientHttpRequestFactory- 参数:
uri- the URI to create a request forhttpMethod- the HTTP method to execute- 返回:
- the created request
- 抛出:
IOException- in case of I/O errors
-