java.lang.Object
org.miaixz.bus.http.plugin.httpz.HttpRequest
org.miaixz.bus.http.plugin.httpz.HeadRequest
Represents an HTTP HEAD request. This class encapsulates all the parameters and configuration for a HEAD request.
HEAD requests are used to retrieve the headers for a resource without fetching the response body.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
Fields inherited from class org.miaixz.bus.http.plugin.httpz.HttpRequest
body, builder, encodedParams, headers, id, list, multipartBody, params, url -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RequestbuildRequest(RequestBody requestBody) Builds the final HttpdRequestobject.protected RequestBodyBuilds the request body.Methods inherited from class org.miaixz.bus.http.plugin.httpz.HttpRequest
build, createRequest, createRequestBody, getId, headers
-
Constructor Details
-
HeadRequest
public HeadRequest(String url, Object tag, Map<String, String> params, Map<String, String> headers, String id) Constructs a newHeadRequest.- Parameters:
url- The request URL.tag- A tag for this request, used for cancellation.params- The query parameters for the request.headers- The request headers.id- A unique identifier for this request.
-
-
Method Details
-
buildRequestBody
Builds the request body. For a HEAD request, the body is always null.- Specified by:
buildRequestBodyin classHttpRequest- Returns:
- Always returns
null.
-
buildRequest
Builds the final HttpdRequestobject.- Specified by:
buildRequestin classHttpRequest- Parameters:
requestBody- The request body, which will be null for a HEAD request.- Returns:
- The constructed
Requestobject.
-