ktor-client-core / io.ktor.client.call / body

body

inline suspend fun <reified T> HttpClientCall.body(): T
inline suspend fun <reified T> HttpResponse.body(): T

Tries to receive the payload of the response as an specific type T.

Exceptions

NoTransformationFoundException - If no transformation is found for the type T.

DoubleReceiveException - If already called body.

suspend fun <T> HttpResponse.body(typeInfo: TypeInfo): T

Tries to receive the payload of the response as an specific type T described in typeInfo.

Exceptions

NoTransformationFoundException - If no transformation is found for the type info typeInfo.

DoubleReceiveException - If already called body.