bodyJson

@ExperimentalSerializationApi
inline fun <T> Request.bodyJson(value: T, json: Json = lenientJson): Request

Encodes the given value as the body of the request.

Parameters

value

information to be encoded

json

(optional) JSON serialization configuration


@ExperimentalSerializationApi
fun <T> Request.bodyJson(value: T, serializer: KSerializer<T>, json: Json = lenientJson): Request

Encodes the given value as the body of the request.

Parameters

value

information to be encoded

serializer

serializer from kotlinx-serialization

json

(optional) JSON serialization configuration