BodyFormat

interface BodyFormat<T>

Defines how a type T is transformed for transmission.

Type Parameters

T

The type of the body to encode/decode.

Inheritors

Properties

Link copied to clipboard
abstract val contentType: String

The content type of the body.

Link copied to clipboard

The serialization engine that produced this format, if any.

Functions

Link copied to clipboard
abstract fun decode(bytes: ByteArray, contentType: String): T

Decodes the byte array into the type T.

Link copied to clipboard
abstract fun encode(value: T): ByteArray

Encodes the value into a byte array for transmission.