execute

suspend fun <T> execute(
    block: suspend (response: HttpResponse) -> T
): T

Executes this statement and call the block with the streaming response.

The response argument holds a network connection until the block isn’t completed. You can read the body on-demand or at once with receive method.

After block finishes, response will be completed body will be discarded or released depends on the engine configuration.

Please note: the response instance will be canceled and shouldn’t be passed outside of block.

suspend fun execute(): HttpResponse

Executes this statement and download the response. After the method finishes, the client downloads the response body in memory and release the connection.

To receive exact type you consider using receive method.