stringBody

fun stringBody(name: String = "string"): StringBody(source)

Creates a text body using a named string codec.

Return

a StringBody backed by a codec that targets UTF-8 strings.

Parameters

name

friendly name used in error messages when encoding/decoding fails.

See also


fun stringBody(codec: ByteArrayCodec<String>, name: String = "string"): StringBody(source)

Creates a text body using the provided codec.

Return

a StringBody using the supplied codec.

Parameters

codec

encoder/decoder that understands the textual payload.