kohttp / io.github.rybalkinsd.kohttp.ext / okhttp3.Response

Extensions for okhttp3.Response

asJson

fun Response.asJson(): JsonNode

Returns Response Body as JSON.If Response is null it returns a empty JSON

asStream

fun Response.asStream(): InputStream?

Returns Response Body as a Stream.

asString

fun Response.asString(): String?

Returns Response Body as String.

eager

fun Response.eager(): EagerResponse

This feature is EXPERIMENTAL, API could be changed in the future releases.