java.lang.Object
org.miaixz.bus.http.plugin.httpz.HttpRequest
org.miaixz.bus.http.plugin.httpz.GetRequest
Represents an HTTP GET request. This class encapsulates all the parameters and configuration for a GET request. GET
requests are used to retrieve a resource and do not have a request 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
ConstructorsConstructorDescriptionGetRequest(String url, Object tag, Map<String, String> params, Map<String, String> headers, String id) Constructs a newGetRequest.GetRequest(String url, Object tag, Map<String, String> params, Map<String, String> encoded, Map<String, String> headers, String id) Constructs a newGetRequestwith both standard and pre-encoded parameters. -
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
-
GetRequest
public GetRequest(String url, Object tag, Map<String, String> params, Map<String, String> headers, String id) Constructs a newGetRequest.- 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.
-
GetRequest
public GetRequest(String url, Object tag, Map<String, String> params, Map<String, String> encoded, Map<String, String> headers, String id) Constructs a newGetRequestwith both standard and pre-encoded parameters.- Parameters:
url- The request URL.tag- A tag for this request, used for cancellation.params- The standard query parameters for the request.encoded- The pre-encoded 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 GET 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 GET request.- Returns:
- The constructed
Requestobject.
-