Header

sealed interface Header<H : Any>(source)

Describes one HTTP header slot in an endpoint contract.

A header can either require the caller to supply a value, via HeaderInput, or carry concrete values up front, via HeaderValues. That lets Tapik use the same abstraction for request headers, dynamic response headers, and fixed response headers.

Inheritors

Types

Link copied to clipboard

Factory helpers and predefined standard headers.

Properties

Link copied to clipboard
abstract val codec: StringCodec<H>

Codec responsible for encoding and decoding header values.

Link copied to clipboard
abstract val name: String

Canonical HTTP header name.

Link copied to clipboard
abstract val required: Boolean

Whether the header must be provided by the caller instead of being pre-populated.

Functions

Link copied to clipboard
open operator fun invoke(): Nothing
open operator fun invoke(vararg values: H): HeaderValues<H>

Binds one or more concrete values to this header definition.