Body

sealed interface Body<T : Any>(source)

Base contract for describing HTTP bodies flowing through an endpoint.

Inheritors

Properties

Link copied to clipboard
abstract val codec: ByteArrayCodec<T>

Codec used to transform between payload instances and raw bytes.

Link copied to clipboard
abstract val mediaType: MediaType?

Preferred media type for the body if known.

Link copied to clipboard
abstract val name: String

Friendly name associated with the body, if provided.

Functions

Link copied to clipboard
open fun bytes(value: T): ByteArray?

Encodes value into a ByteArray.