java.lang.Object
org.miaixz.bus.http.RealCall
HTTP 请求的实际执行者
负责执行同步和异步 HTTP 请求,通过拦截器链处理请求和响应。 支持 WebSocket 连接、请求取消、超时管理和重试机制。
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.miaixz.bus.http.NewCall
NewCall.Factory -
Field Summary
Fields -
Method Summary
-
Field Details
-
client
HTTP 客户端 -
originalRequest
原始请求 -
forWebSocket
public final boolean forWebSocket是否为 WebSocket 请求 -
transmitter
请求传输器 -
executed
public boolean executed是否已执行
-
-
Method Details
-
request
获取原始请求 -
execute
同步执行请求- Specified by:
executein interfaceNewCall- Returns:
- 响应
- Throws:
IOException- 如果执行失败IllegalStateException- 如果请求已执行
-
enqueue
异步执行请求- Specified by:
enqueuein interfaceNewCall- Parameters:
responseCallback- 响应回调- Throws:
IllegalStateException- 如果请求已执行
-
cancel
public void cancel()取消请求 -
timeout
public org.miaixz.bus.core.io.timout.Timeout timeout()获取超时配置 -
isExecuted
public boolean isExecuted()检查是否已执行- Specified by:
isExecutedin interfaceNewCall- Returns:
- true 如果已执行
-
isCanceled
public boolean isCanceled()检查是否已取消- Specified by:
isCanceledin interfaceNewCall- Returns:
- true 如果已取消
-
clone
克隆 RealCall 实例 -
toLoggableString
获取可记录的字符串表示- Returns:
- 描述调用的字符串(不包含完整 URL)
-
redactedUrl
获取隐藏敏感信息的 URL- Returns:
- 隐藏敏感信息的 URL
-
getResponseWithInterceptorChain
通过拦截器链获取响应- Returns:
- 响应
- Throws:
IOException- 如果执行失败
-