Client

interface Client(source)

Marker interface that provides helper extensions common to generated clients.

Client implementations receive these utilities so that generated DSL pieces can safely cast metadata objects and unwrap required values without duplicating logic.

Functions

Link copied to clipboard
open fun <T : Any> Any?.asHeaderValues(): HeaderValues<T>

Casts the receiver to HeaderValues of T, failing with a descriptive error otherwise.

Link copied to clipboard

Casts the receiver to a QueryParameter of T, failing with a descriptive error otherwise.

Link copied to clipboard

Returns the default value of the query parameter, throwing if it is missing.

Link copied to clipboard

Returns the first header value from the collection, throwing if it is missing.