Skip to content

Client-side typesafe Spine schema usageopensavvy.spine.clientbodyOrThrow

bodyOrThrow

inline suspend fun <Out : Any> SpineResponse<Out, *>.bodyOrThrow(): Out

Deserializes the response body, throwing a SpineReceptionException if the response is not successful.

The Ktor ContentNegotation plugin may be necessary for this function to work.

Example

client.request(Api / Users / Users.list).bodyOrThrow()

See also