blockingGet

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

Performs a blocking HTTP GET request using a temporary HttpClient.

Creates a new client, executes the GET request, and blocks the current thread until the response is received and processed.

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