@Incubating
final class HttpClientHelper
extends Object
Runtime helper used by the generated declarative HTTP client implementations. Not intended for direct use.
| Constructor and description |
|---|
HttpClientHelper(String baseUrl, Map<String, String> defaultHeaders)Creates a helper with default timeout and redirect settings. |
HttpClientHelper(String baseUrl, Map<String, String> defaultHeaders, int connectTimeoutSeconds, int requestTimeoutSeconds, boolean followRedirects)Creates a helper backed by a new HttpBuilder. |
HttpClientHelper(HttpBuilder http, Map<String, String> defaultHeaders)Constructor accepting a pre-configured HttpBuilder instance. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
Object |
execute(String method, String urlTemplate, String returnTypeName, Map<String, Object> pathParams, Map<String, Object> queryOrFormParams, Map<String, String> headers, Object body, int timeoutSeconds, String bodyMode, String errorTypeName)Execute an HTTP request synchronously. |
|
CompletableFuture<Object> |
executeAsync(String method, String urlTemplate, String returnTypeName, Map<String, Object> pathParams, Map<String, Object> queryOrFormParams, Map<String, String> headers, Object body, int timeoutSeconds, String bodyMode, String errorTypeName)Execute an HTTP request asynchronously. |
Creates a helper with default timeout and redirect settings.
baseUrl - the base URL used by generated clientsdefaultHeaders - the headers applied to every requestCreates a helper backed by a new HttpBuilder.
baseUrl - the base URL used by generated clientsdefaultHeaders - the headers applied to every requestconnectTimeoutSeconds - the connect timeout in seconds, or 0 for nonerequestTimeoutSeconds - the request timeout in seconds, or 0 for nonefollowRedirects - whether redirects should be followed automaticallyConstructor accepting a pre-configured HttpBuilder instance. Used by the create(Closure) factory for advanced configuration.
http - the pre-configured HTTP builder to reusedefaultHeaders - the headers applied to every requestExecute an HTTP request synchronously.
method - HTTP method (GET, POST, PUT, DELETE, PATCH)urlTemplate - URL template with {param} placeholdersreturnTypeName - the method's return type name for response conversionpathParams - map of path parameter names to valuesqueryOrFormParams - map of query parameter names or form fields to valuesheaders - map of additional headers for this requestbody - request body (serialized as JSON if non-null)timeoutSeconds - per-request timeout in seconds, or 0 for nonebodyMode - serialization mode for the request bodyerrorTypeName - fully qualified exception type used for HTTP error responsesExecute an HTTP request asynchronously.
method - HTTP method (GET, POST, PUT, DELETE, PATCH)urlTemplate - URL template with {param} placeholdersreturnTypeName - the method's return type name for response conversionpathParams - map of path parameter names to valuesqueryOrFormParams - map of query parameter names or form fields to valuesheaders - map of additional headers for this requestbody - request body before serializationtimeoutSeconds - per-request timeout in seconds, or 0 for nonebodyMode - serialization mode for the request bodyerrorTypeName - fully qualified exception type used for HTTP error responsesCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.