get

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

Performs an HTTP GET request on this HttpClient and passes the response to block.

This is an extension function on HttpClient.

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