java.lang.Object
org.miaixz.bus.http.plugin.httpz.RequestCall
Represents an executable HTTP request. This class is responsible for building the final
Request object from
an HttpRequest and executing it either synchronously or asynchronously.- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds the underlyingNewCallfrom theHttpRequestconfiguration.voidcancel()Cancels the request if it is in flight.execute()Executes the HTTP request synchronously.voidexecuteAsync(Callback callback) Executes the HTTP request asynchronously.
-
Constructor Details
-
RequestCall
Constructs a new RequestCall.- Parameters:
request- The abstractHttpRequestconfiguration.httpd- TheHttpdclient instance.
-
-
Method Details
-
buildCall
Builds the underlyingNewCallfrom theHttpRequestconfiguration.- Parameters:
callback- The callback to be used for the request.- Returns:
- The prepared
NewCall.
-
execute
Executes the HTTP request synchronously. -
executeAsync
Executes the HTTP request asynchronously.- Parameters:
callback- The callback to handle the response or failure.
-
getNewCall
- Returns:
- The underlying Httpd
NewCallinstance.
-
getRequest
- Returns:
- The final, built Httpd
Requestobject.
-
getHttpRequest
- Returns:
- The abstract
HttpRequestconfiguration.
-
cancel
public void cancel()Cancels the request if it is in flight.
-