ktor-client-core / io.ktor.client.statement / receive

receive

inline suspend fun <reified T> HttpStatement.receive(): T
Deprecated: Use `body` method instead

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 <reified T, R> HttpStatement.receive(crossinline block: suspend (response: T) -> R): R
Deprecated: Use `body` method instead

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

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