Zeta Http Client Builder
Fluent builder for constructing a configured HttpClient instance for the Zeta SDK.
The builder groups configuration into four areas:
Base URL: override the server base URL for all requests.
Network: connection/request timeouts and retry policy.
Security: additional trusted CA certificates (PEM).
Monitoring: client log verbosity.
Defaults come from NetworkConfig, SecurityConfig, and MonitoringConfig.
Typical usage:
return ZetaHttpClientBuilder()
.baseUrl("https://base-url.de")
.timeouts(connectMs = 5_000, requestMs = 15_000)
.retry(
statusCodes = setOf(HttpStatusCode.TooManyRequests, HttpStatusCode.ServiceUnavailable),
maxRetries = 3,
onlyIdempotent = true
)
.addCaPem("-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----")
.logging(LogLevel.INFO)
.build()Thread-safety: the builder is mutable and not thread-safe. Build once and share the resulting HttpClient.
Functions
Append an additional trusted Certificate Authority (CA) in PEM format.
Set the client log verbosity used for request/response monitoring.
Replace the entire list of additional trusted CAs.
Configure connection and/or overall request timeouts (milliseconds).