- java.lang.Object
-
- org.redkale.net.client.Client<org.redkale.net.http.WebConnection,WebRequest,WebResult>
-
- org.redkale.net.http.WebClient
-
- 所有已实现的接口:
Resourcable
public class WebClient extends Client<org.redkale.net.http.WebConnection,WebRequest,WebResult>
简单的HttpClient实现, 存在以下情况不能使用此类:
1、使用HTTPS;
2、上传下载文件;
3、返回超大响应包;
类似JDK11的 java.net.http.HttpClient
详情见: https://redkale.org
- 从以下版本开始:
- 2.3.0
- 作者:
- zhangjx
- 另请参阅:
WebCodec
,WebConnection
,WebRequest
,WebResult
-
-
嵌套类概要
-
从类继承的嵌套类/接口 org.redkale.net.client.Client
Client.AddressConnEntry<C>
-
-
字段概要
字段 修饰符和类型 字段 说明 protected AsyncGroup
asyncGroup
static String
USER_AGENT
protected ExecutorService
workExecutor
-
从类继承的字段 org.redkale.net.client.Client
authenticate, closeRequestSupplier, connectTimeoutSeconds, debug, DEFAULT_MAX_PIPELINES, group, logger, maxPipelines, name, nonBlocking, pingRequestSupplier, random, readTimeoutSeconds, reqWritedCounter, respDoneCounter, tcp, timeoutFuture, timeoutScheduler, writeTimeoutSeconds
-
-
构造器概要
构造器 限定符 构造器 说明 protected
WebClient(ExecutorService workExecutor, AsyncGroup asyncGroup)
-
方法概要
-
从类继承的方法 org.redkale.net.client.Client
close, connect, connect, connect, connect, createClientFuture, createVirtualRequestAfterConnect, getAddress, getMaxConns, getName, getReadTimeoutSeconds, getWriteTimeoutSeconds, handlePingResult, incrReqWritedCounter, incrRespDoneCounter, newConnection, newConnection, pingIntervalSeconds, resourceName, sendAsync, sendAsync, sendAsync, sendAsync, setReadTimeoutSeconds, setWriteTimeoutSeconds, updateClientAddress, writeChannel, writeChannel, writeChannel
-
-
-
-
字段详细资料
-
USER_AGENT
public static final String USER_AGENT
-
asyncGroup
protected final AsyncGroup asyncGroup
-
workExecutor
protected ExecutorService workExecutor
-
-
构造器详细资料
-
WebClient
protected WebClient(ExecutorService workExecutor, AsyncGroup asyncGroup)
-
-
方法详细资料
-
create
public static WebClient create(ExecutorService workExecutor, AsyncGroup asyncGroup)
-
create
public static WebClient create(AsyncGroup asyncGroup)
-
createClientConnection
protected org.redkale.net.http.WebConnection createClientConnection(AsyncConnection channel)
- 指定者:
createClientConnection
在类中Client<org.redkale.net.http.WebConnection,WebRequest,WebResult>
-
writeChannel
protected CompletableFuture<WebResult> writeChannel(ClientConnection conn, WebRequest request)
- 覆盖:
writeChannel
在类中Client<org.redkale.net.http.WebConnection,WebRequest,WebResult>
-
readTimeoutSeconds
public WebClient readTimeoutSeconds(int readTimeoutSeconds)
-
writeTimeoutSeconds
public WebClient writeTimeoutSeconds(int writeTimeoutSeconds)
-
getAsync
public CompletableFuture<HttpResult<byte[]>> getAsync(String url)
-
getAsync
public CompletableFuture<HttpResult<byte[]>> getAsync(String url, String body)
-
getAsync
public CompletableFuture<HttpResult<byte[]>> getAsync(String url, Type valueType)
-
getAsync
public CompletableFuture<HttpResult<byte[]>> getAsync(String url, String body, Type valueType)
-
getAsync
public CompletableFuture<HttpResult<byte[]>> getAsync(String url, Convert convert, Type valueType)
-
getAsync
public CompletableFuture<HttpResult<byte[]>> getAsync(String url, String body, Convert convert, Type valueType)
-
getAsync
public CompletableFuture<HttpResult<byte[]>> getAsync(String url, byte[] body)
-
getAsync
public CompletableFuture<HttpResult<byte[]>> getAsync(String url, byte[] body, Type valueType)
-
getAsync
public CompletableFuture<HttpResult<byte[]>> getAsync(String url, byte[] body, Convert convert, Type valueType)
-
getAsync
public CompletableFuture<HttpResult<byte[]>> getAsync(String url, HttpHeaders headers)
-
getAsync
public CompletableFuture<HttpResult<byte[]>> getAsync(String url, HttpHeaders headers, Type valueType)
-
getAsync
public CompletableFuture<HttpResult<byte[]>> getAsync(String url, HttpHeaders headers, Convert convert, Type valueType)
-
getAsync
public CompletableFuture<HttpResult<byte[]>> getAsync(String url, HttpHeaders headers, String body)
-
getAsync
public CompletableFuture<HttpResult<byte[]>> getAsync(String url, HttpHeaders headers, byte[] body)
-
postAsync
public CompletableFuture<HttpResult<byte[]>> postAsync(String url)
-
postAsync
public CompletableFuture<HttpResult<byte[]>> postAsync(String url, String body)
-
postAsync
public CompletableFuture<HttpResult<byte[]>> postAsync(String url, Type valueType)
-
postAsync
public CompletableFuture<HttpResult<byte[]>> postAsync(String url, String body, Type valueType)
-
postAsync
public CompletableFuture<HttpResult<byte[]>> postAsync(String url, Convert convert, Type valueType)
-
postAsync
public CompletableFuture<HttpResult<byte[]>> postAsync(String url, String body, Convert convert, Type valueType)
-
postAsync
public CompletableFuture<HttpResult<byte[]>> postAsync(String url, byte[] body)
-
postAsync
public CompletableFuture<HttpResult<byte[]>> postAsync(String url, byte[] body, Type valueType)
-
postAsync
public CompletableFuture<HttpResult<byte[]>> postAsync(String url, byte[] body, Convert convert, Type valueType)
-
postAsync
public CompletableFuture<HttpResult<byte[]>> postAsync(String url, HttpHeaders headers)
-
postAsync
public CompletableFuture<HttpResult<byte[]>> postAsync(String url, HttpHeaders headers, Type valueType)
-
postAsync
public CompletableFuture<HttpResult<byte[]>> postAsync(String url, HttpHeaders headers, Convert convert, Type valueType)
-
postAsync
public CompletableFuture<HttpResult<byte[]>> postAsync(String url, HttpHeaders headers, String body)
-
postAsync
public CompletableFuture<HttpResult<byte[]>> postAsync(String url, HttpHeaders headers, byte[] body)
-
sendAsync
public CompletableFuture<HttpResult<byte[]>> sendAsync(String url, WebRequest req)
-
sendAsync
public <T> CompletableFuture<HttpResult<T>> sendAsync(String url, WebRequest req, Type valueType)
-
sendAsync
public CompletableFuture<HttpResult<byte[]>> sendAsync(String method, String url, HttpHeaders headers, byte[] body)
-
sendAsync
public <T> CompletableFuture<HttpResult<T>> sendAsync(String method, String url, HttpHeaders headers, byte[] body, Type valueType)
-
sendAsync
public <T> CompletableFuture<HttpResult<T>> sendAsync(String method, String url, HttpHeaders headers, byte[] body, Convert convert, Type valueType)
-
-