类 NativeHttpClient
java.lang.Object
io.github.wooenrico.http.URLConnection.NativeHttpClient
- 所有已实现的接口:
HttpExecutor
- 直接已知子类:
ProxyBasicAuthNativeHttpClient
NativeHttpClient
-
构造器概要
构造器构造器说明NativeHttpClient
(SSLContext sslContext, HostnameVerifier hostnameVerifier, Proxy proxy, int connectTimeout, int readTimeout) Constructs a new NativeHttpClient. -
方法概要
修饰符和类型方法说明execute
(HttpRequest httpRequest) 执行http请求execute
(HttpRequest httpRequest, Executor executor) 异步执行http请求int
Returns the connectTimeout of the client.Returns the HostnameVerifier of the client.getProxy()
Returns the Proxy of the client.int
Returns the readTimeout of the client.Returns the SSLContext of the client.getUrlConnection
(URL url) Returns the HttpURLConnection of the URL.
-
构造器详细资料
-
NativeHttpClient
public NativeHttpClient(SSLContext sslContext, HostnameVerifier hostnameVerifier, Proxy proxy, int connectTimeout, int readTimeout) Constructs a new NativeHttpClient.- 参数:
sslContext
- SSLContexthostnameVerifier
- HostnameVerifierproxy
- ProxyconnectTimeout
- connectTimeout in millisecondsreadTimeout
- readTimeout in milliseconds
-
-
方法详细资料
-
getSslContext
Returns the SSLContext of the client.- 返回:
- the SSLContext of the client
-
getHostnameVerifier
Returns the HostnameVerifier of the client.- 返回:
- the HostnameVerifier of the client
-
getProxy
Returns the Proxy of the client.- 返回:
- the Proxy of the client
-
getConnectTimeout
public int getConnectTimeout()Returns the connectTimeout of the client.- 返回:
- the connectTimeout of the client
-
getReadTimeout
public int getReadTimeout()Returns the readTimeout of the client.- 返回:
- the readTimeout of the client
-
getUrlConnection
Returns the HttpURLConnection of the URL.- 参数:
url
- URL- 返回:
- the HttpURLConnection of the URL
- 抛出:
IOException
- if an I/O error occurs
-
execute
从接口复制的说明:HttpExecutor
执行http请求- 指定者:
execute
在接口中HttpExecutor
- 参数:
httpRequest
- http请求内容- 返回:
- HttpResponse http响应
- 抛出:
IOException
-
execute
从接口复制的说明:HttpExecutor
异步执行http请求- 指定者:
execute
在接口中HttpExecutor
- 参数:
httpRequest
- http请求内容executor
- 线程池- 返回:
- CompletableFuture of HttpResponse http响应
-