Encoder

fun Encoder(format: SerialFormat, vararg mediaTypes: MediaType): BodyAdapter.Encoder

Creates an encoder that uses the given SerialFormat for encoding objects and is compatible with the given media types.

Throws

if the given SerialFormat is neither a StringFormat nor a BinaryFormat