Skip to content

//okhttp/okhttp3/Response/body

body

[common]\ expect val body: ResponseBody

Returns a non-null value if this response was passed to Callback.onResponse or returned from Call.execute. Response bodies must be closed and may be consumed only once.

This always returns null on responses returned from cacheResponse, networkResponse, and priorResponse.

[jvm]\

@get:JvmName(name = "body")

actual val body: ResponseBody

[nonJvm]\ actual val body: ResponseBody

Returns a non-null value if this response was passed to Callback.onResponse or returned from Call.execute. Response bodies must be closed and may be consumed only once.

This always returns null on responses returned from cacheResponse, networkResponse, and priorResponse.