body

inline suspend fun <T> body(): T

Executes this statement and runs HttpClient.responsePipeline with the response and expected type T.

Note if T is a streaming type, you should manage how to close it manually.


inline suspend fun <T, R> body(crossinline block: suspend (response: T) -> R): R

Executes this statement and runs the block with a HttpClient.responsePipeline execution result.

Note that T can be a streamed type such as ByteReadChannel.