vertx / io.vertx.kotlin.ext.web.client / io.vertx.ext.web.client.HttpRequest

Extensions for io.vertx.ext.web.client.HttpRequest

sendAwait

suspend fun <T> HttpRequest<T>.sendAwait(): HttpResponse<T>

Send a request, the handler will receive the response as an io.vertx.ext.web.client.HttpResponse.

sendBufferAwait

suspend fun <T> HttpRequest<T>.sendBufferAwait(body: Buffer): HttpResponse<T>

Like io.vertx.ext.web.client.HttpRequest but with an HTTP request body buffer.

sendFormAwait

suspend fun <T> HttpRequest<T>.sendFormAwait(body: MultiMap): HttpResponse<T>

Like io.vertx.ext.web.client.HttpRequest but with an HTTP request body multimap encoded as form and the content type set to application/x-www-form-urlencoded.

sendJsonAwait

suspend fun <T> HttpRequest<T>.sendJsonAwait(body: Any): HttpResponse<T>

Like io.vertx.ext.web.client.HttpRequest but with an HTTP request body object encoded as json and the content type set to application/json.

sendJsonObjectAwait

suspend fun <T> HttpRequest<T>.sendJsonObjectAwait(body: JsonObject): HttpResponse<T>

Like io.vertx.ext.web.client.HttpRequest but with an HTTP request body object encoded as json and the content type set to application/json.

sendMultipartFormAwait

suspend fun <T> HttpRequest<T>.sendMultipartFormAwait(body: MultipartForm): HttpResponse<T>

Like io.vertx.ext.web.client.HttpRequest but with an HTTP request body multimap encoded as form and the content type set to multipart/form-data. You may use this method to send attributes and upload files.

sendStreamAwait

suspend fun <T> HttpRequest<T>.sendStreamAwait(body: ReadStream<Buffer>): HttpResponse<T>

Like io.vertx.ext.web.client.HttpRequest but with an HTTP request body stream.