NetworkClientConfiguration
Immutable configuration for a NetworkClient. Mirrors SwiftyNetwork's NetworkClientConfiguration.
Constructors
Properties
supplies/refreshes credentials for requests without their own.
OkHttp interceptors (e.g. an APITrace recorder) added to the engine.
optional telemetry sink.
how many times to refresh-and-retry after a 401.
optional OkHttp disk cache honoring backend Cache-Control/ETag.
escape hatch to configure the underlying OkHttpClient.Builder directly (e.g. to install a bootstrap that needs the builder). Ignored when engine is set.
optional connectivity gate (e.g. networkMonitor.asReachabilityGate()): before each retry's backoff, the client waits up to reachabilityWaitMillis for connectivity, so retries park while offline instead of burning attempts. null disables the wait. External retry loops can also wait before each request with withRetryPolicy's awaitReachabilityBeforeRequest option; MutationQueue enables it automatically.
cap on how long a single retry waits on reachabilityGate.
optional hook supplying extra headers per attempt (see RequestHeaderProvider) — the place to inject trace-propagation headers (e.g. traceparent) read from whatever context the request interceptor made current for that attempt. null (the default) adds no headers.
optional hook wrapping each attempt (see RequestInterceptor) — the place to create a tracing span with an accurate start/end and propagate its context. null (the default) runs attempts directly, with no observable behavior change.
delay between a successful refresh and the retry.
decides whether/when to retry a failed request. Defaults to DefaultRetryPolicy (jittered exponential backoff for timeouts, lost connectivity, 429, and 5xx, honoring Retry-After). Supply your own or RetryPolicy.None to disable retries. withRetryPolicy replaces it for the requests made inside one block.
optional certificate pinning.
per-request timeout.