coSend

suspend fun <T> HttpClient.coSend(request: HttpRequest, bodyHandler: HttpResponse.BodyHandler<T>): HttpResponse<T>
suspend fun <T> HttpClient.coSend(bodyHandler: HttpResponse.BodyHandler<T>, request: suspend () -> HttpRequest): HttpResponse<T>

Sends an HTTP request and returns the HTTP response.

Return

The HTTP response.

Parameters

request

The HTTP request to send.

bodyHandler

The body handler to process the HTTP response body.


suspend fun <T> HttpRequest.coSend(bodyHandler: HttpResponse.BodyHandler<T>, client: HttpClient = DefaultHttpClient): HttpResponse<T>

Sends this HTTP request and returns the HTTP response.

Return

The HTTP response.

Parameters

bodyHandler

The body handler to process the HTTP response body.

client

The HTTP client used to send the request.