static final class HttpBuilder.Config
extends Object
Configuration DSL used to create an HttpBuilder.
| Type | Name and description |
|---|---|
URI |
baseUriAbsolute base URI used to resolve relative request URIs. |
Closure<?> |
clientConfigurerOptional hook for advanced HttpClient.Builder customization. |
Duration |
connectTimeoutTimeout applied when opening connections. |
boolean |
followRedirectsWhether redirects should be followed automatically. |
Map<String, String> |
headersHeaders added to every request created by the builder. |
Duration |
requestTimeoutTimeout applied to each request when not overridden. |
| Constructor and description |
|---|
HttpBuilder.Config() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
baseUri(Object value)Sets the absolute base URI used for relative requests. |
|
void |
clientConfig(Closure<?> configurer)Provides direct access to the underlying HttpClient.Builder
for advanced configuration (authenticator, SSL context, proxy, cookie handler, etc.). |
|
void |
connectTimeout(Duration value)Sets the client connect timeout. |
|
void |
followRedirects(boolean value)Enables or disables automatic redirect following. |
|
void |
header(String name, Object value)Adds a default header to every request. |
|
void |
headers(Map<String, ?> values)Adds multiple default headers to every request. |
|
void |
requestTimeout(Duration value)Sets the default request timeout. |
Absolute base URI used to resolve relative request URIs.
Optional hook for advanced HttpClient.Builder customization.
Timeout applied when opening connections.
Whether redirects should be followed automatically.
Timeout applied to each request when not overridden.
Sets the absolute base URI used for relative requests.
value - the base URI as a URI or coercible string Provides direct access to the underlying HttpClient.Builder
for advanced configuration (authenticator, SSL context, proxy, cookie handler, etc.).
configurer - a closure taking an HttpClient.BuilderSets the client connect timeout.
value - the connection timeoutEnables or disables automatic redirect following.
value - true to follow redirectsAdds a default header to every request.
name - the header namevalue - the header valueAdds multiple default headers to every request.
values - the headers to addSets the default request timeout.
value - the request timeoutCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.