CallSpec

The per-call settings of UpstreamClient.call: the receiver of its lambda. Stable Core. Every property is seeded, so reading it inside the lambda gives the effective value (maxWait = maxWait * 2 doubles the client's default). Not thread-safe; use it only inside the lambda.

Properties

Link copied to clipboard

The request body; null (none) by default. A body on GET is an InvalidRequest.

Link copied to clipboard
var lane: Lane

The lane this call is charged to; the endpoint's lane by default.

Link copied to clipboard

The oldest cached answer this call accepts; Duration.INFINITE (any live entry) by default. Not negative.

Link copied to clipboard

The longest the call waits for a budget permit before failing with BudgetExhausted; the client's defaultMaxWait by default. Not negative.

Link copied to clipboard

The request method; GET by default. Only GET goes through the cache.

Functions

Link copied to clipboard
fun headers(configure: HttpHeaders.Builder.() -> Unit)

Edits this call's request headers, which start as the client's default headers: add appends, set and setSensitive replace, remove drops. Several blocks edit the same builder. Per-call headers are not part of the cache key: do not use one that changes the answer on a cached endpoint.

Link copied to clipboard
fun path(vararg segments: String)

Appends raw path segments, each encoded when the request is built (a /, ? or % inside one is encoded, never interpreted). A ., .. or empty segment, or one with an unpaired surrogate, makes the call an InvalidRequest.

Link copied to clipboard
fun query(name: String, value: String)

Appends one raw query pair, name and value each encoded when the request is built. A repeated name is allowed; the order is kept.