execute

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

Executes this statement and calls 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 body() 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 execution finishes, the client downloads the response body in memory and release the connection.

To receive exact type, consider using body() method.