retry

fun retry(statusCodes: Set<HttpStatusCode> = network.retryStatusCodes, maxRetries: Int = network.maxRetries, onlyIdempotent: Boolean = network.retryOnlyIdempotent): ZetaHttpClientBuilder

Configure automatic retry behavior for responses with specific HTTP status codes.

Return

This builder for chaining.

Parameters

statusCodes

Set of HTTP status codes that should trigger a retry. Defaults to the current value in NetworkConfig.

maxRetries

Maximum number of retry attempts (excluding the initial attempt). Defaults to the current value in NetworkConfig.

onlyIdempotent

When true, retries are limited to idempotent HTTP methods (e.g., GET/HEAD/PUT/DELETE). Semantics depend on the underlying client.