wrapWithContent

fun HttpClientCall.wrapWithContent(content: ByteReadChannel): HttpClientCall(source)

Deprecated

Use 'replaceResponse' instead.

Replace with

import io.ktor.client.call.replaceResponse
replaceResponse { content }

Wrap existing HttpClientCall with new content.

Warning: The content of the returned call response is non-replayable, so it can be consumed only once. Consider using replaceResponse instead.

Report a problem


fun HttpClientCall.wrapWithContent(block: () -> ByteReadChannel): HttpClientCall(source)

Deprecated

Use 'replaceResponse' instead.

Replace with

import io.ktor.client.call.replaceResponse
replaceResponse { block() }

Wrap existing HttpClientCall with new content produced by the given block. The block will be called each time the response content is requested.

Report a problem