blockingGet

fun <T> KtorDsl.blockingGet(url: String, setUp: HttpRequestBuilder.() -> Unit = {}, block: suspend (HttpResponse) -> T): T

Performs a blocking HTTP GET request using a temporary io.ktor.client.HttpClient.

Creates a new client, executes the GET request, and blocks the current thread until the response is received and processed. JVM only (uses runBlocking); declared as an extension on KtorDsl so KtorDsl.blockingGet(...) call sites keep compiling.

Return

the result of block

Parameters

url

the URL to send the GET request to

setUp

an optional configuration block for the HttpRequestBuilder

block

a suspending block that receives the HttpResponse

Type Parameters

T

the return type of the block