receive

inline suspend fun <T> receive(): T

Executes this statement and run 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> receive(crossinline block: suspend (T) -> R): R

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

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