java.lang.Object
org.miaixz.bus.http.plugin.httpv.CoverHttp<CoverHttp.Async>
org.miaixz.bus.http.plugin.httpv.CoverHttp.Async
- All Implemented Interfaces:
Cancelable
A builder for asynchronous HTTP requests.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Nested Class Summary
Nested classes/interfaces inherited from class org.miaixz.bus.http.plugin.httpv.CoverHttp
CoverHttp.Async, CoverHttp.Sync -
Field Summary
Fields inherited from class org.miaixz.bus.http.plugin.httpv.CoverHttp
httpv, nextOnIO, nothrow, skipPreproc, skipSerialPreproc -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondelete()Executes an asynchronous DELETE request.get()Executes an asynchronous GET request.head()Executes an asynchronous HEAD request.patch()Executes an asynchronous PATCH request.post()Executes an asynchronous POST request.put()Executes an asynchronous PUT request.Executes an asynchronous HTTP request with the specified method.setOnComplete(Callback<CoverResult.State> onComplete) Sets the callback for when the request is complete (will be called in all cases).setOnException(Callback<IOException> onException) Sets the callback for exceptions.setOnResponse(Callback<CoverResult> onResponse) Sets the callback for a successful HTTP response.Methods inherited from class org.miaixz.bus.http.plugin.httpv.CoverHttp
addBodyPara, addBodyPara, addFilePara, addFilePara, addFilePara, addFilePara, addHeader, addHeader, addPathPara, addPathPara, addUrlPara, addUrlPara, assertNotConflict, bind, bodyType, cancel, charset, charset, getBodyType, getBound, getHeaders, getTag, getUrl, isTagged, nextOnIO, nothrow, prepareCall, prepareRequest, registeTagTask, removeTagTask, setBodyPara, setOnProcess, setRange, setRange, skipPreproc, skipSerialPreproc, stepBytes, stepRate, tag, timeoutAwait, timeoutResult, toState
-
Constructor Details
-
Async
Constructs a new asynchronous request builder.- Parameters:
htttpv- The Httpv instance.url- The request URL.
-
-
Method Details
-
setOnException
Sets the callback for exceptions. When set, exceptions will not be thrown.- Parameters:
onException- The exception callback.- Returns:
- This Async instance for chaining.
-
setOnComplete
Sets the callback for when the request is complete (will be called in all cases).- Parameters:
onComplete- The completion callback.- Returns:
- This Async instance for chaining.
-
setOnResponse
Sets the callback for a successful HTTP response.- Parameters:
onResponse- The response callback.- Returns:
- This Async instance for chaining.
-
get
Executes an asynchronous GET request.- Returns:
- A GiveCall object to control and get the result of the async call.
-
head
Executes an asynchronous HEAD request.- Returns:
- A GiveCall object to control and get the result of the async call.
-
post
Executes an asynchronous POST request.- Returns:
- A GiveCall object to control and get the result of the async call.
-
put
Executes an asynchronous PUT request.- Returns:
- A GiveCall object to control and get the result of the async call.
-
patch
Executes an asynchronous PATCH request.- Returns:
- A GiveCall object to control and get the result of the async call.
-
delete
Executes an asynchronous DELETE request.- Returns:
- A GiveCall object to control and get the result of the async call.
-
request
Executes an asynchronous HTTP request with the specified method.- Parameters:
method- The HTTP method.- Returns:
- A GiveCall object to control and get the result of the async call.
-