Package com.imyeyu.network
Class ProgressiveRequest
java.lang.Object
com.imyeyu.network.CommonRequest
com.imyeyu.network.JacksonRequest
com.imyeyu.network.FileRequest
com.imyeyu.network.ProgressiveRequest
封装
Request 计算返回进度- Since:
- 2025-06-26 13:03
- Author:
- 夜雨
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class com.imyeyu.network.CommonRequest
request -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProgressiveRequest(org.apache.hc.client5.http.fluent.Request request, ProgressiveRequest.ProgressiveCallback callback) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]asBytes()asString()设置 JSON 请求体。bodyEntity(org.apache.hc.core5.http.HttpEntity entity) static ProgressiveRequestget(String url, ProgressiveRequest.ProgressiveCallback callback) static ProgressiveRequestpost(String url, ProgressiveRequest.ProgressiveCallback callback) timeout(long ms) voidvoidstatic ProgressiveRequestwrap(org.apache.hc.client5.http.fluent.Request request, ProgressiveRequest.ProgressiveCallback callback) Methods inherited from class com.imyeyu.network.JacksonRequest
asJsonArray, asJsonNode, asJsonObject, getObjectMapper, objectMapper, resultAs, resultAs, resultAsMethods inherited from class com.imyeyu.network.CommonRequest
asNumber, asStream, execute
-
Field Details
-
callback
-
-
Constructor Details
-
ProgressiveRequest
protected ProgressiveRequest(org.apache.hc.client5.http.fluent.Request request, ProgressiveRequest.ProgressiveCallback callback)
-
-
Method Details
-
wrap
public static ProgressiveRequest wrap(org.apache.hc.client5.http.fluent.Request request, ProgressiveRequest.ProgressiveCallback callback) -
get
-
post
-
timeout
- Overrides:
timeoutin classFileRequest
-
header
- Overrides:
headerin classFileRequest
-
token
- Overrides:
tokenin classFileRequest
-
language
- Overrides:
languagein classFileRequest
-
body
Description copied from class:JacksonRequest设置 JSON 请求体。- Overrides:
bodyin classFileRequest- Parameters:
object- 要序列化的对象- Returns:
- 当前请求
-
bodyEntity
- Overrides:
bodyEntityin classFileRequest
-
toFile
- Overrides:
toFilein classFileRequest- Throws:
IOExceptionNoPermissionException
-
toFile
- Overrides:
toFilein classFileRequest- Throws:
IOExceptionNoPermissionException
-
asString
- Overrides:
asStringin classCommonRequest- Throws:
IOException
-
asBytes
- Overrides:
asBytesin classCommonRequest- Throws:
IOException
-