Class HttpRequest<T>
- java.lang.Object
-
- io.vertx.mutiny.ext.web.client.HttpRequest<T>
-
public class HttpRequest<T> extends Object
A client-side HTTP request.Instances are created by an
WebClient
instance, via one of the methods corresponding to the specific HTTP methods such asWebClient.get(java.lang.String)
, etc...The request shall be configured prior sending, the request is immutable and when a mutator method is called, a new request is returned allowing to expose the request in a public API and apply further customization.
After the request has been configured, the methods
send()
sendStream(io.vertx.mutiny.core.streams.ReadStream<io.vertx.mutiny.core.buffer.Buffer>)
sendJson(java.lang.Object)
()}sendForm(io.vertx.mutiny.core.MultiMap)
sendXXX
methods perform the actual request, they can be called multiple times to perform the same HTTP request at different points in time.The handler is called back with
- an
HttpResponse
instance when the HTTP response has been received - a failure when the HTTP request failed (like a connection error) or when the HTTP response could not be obtained (like connection or unmarshalling errors)
Most of the time, this client will buffer the HTTP response fully unless a specific is used such as .
NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<HttpRequest>
__TYPE_ARG
TypeArg<T>
__typeArg_0
-
Constructor Summary
Constructors Constructor Description HttpRequest(io.vertx.ext.web.client.HttpRequest delegate)
HttpRequest(io.vertx.ext.web.client.HttpRequest delegate, TypeArg<T> typeArg_0)
HttpRequest(Object delegate, TypeArg<T> typeArg_0)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description HttpRequest<T>
addQueryParam(String paramName, String paramValue)
<U> HttpRequest<U>
as(BodyCodec<U> responseCodec)
HttpRequest<T>
authentication(io.vertx.ext.auth.authentication.Credentials credentials)
HttpRequest<T>
basicAuthentication(Buffer id, Buffer password)
HttpRequest<T>
basicAuthentication(String id, String password)
HttpRequest<T>
bearerTokenAuthentication(String bearerToken)
BodyCodec<T>
bodyCodec()
long
connectTimeout()
HttpRequest<T>
connectTimeout(long timeout)
HttpRequest<T>
copy()
boolean
equals(Object o)
HttpRequest<T>
expect(ResponsePredicate predicate)
Deprecated.instead useHttpResponseExpectation
along withFuture.expecting(Expectation)
HttpRequest<T>
expect(Function<HttpResponse<Void>,ResponsePredicateResult> predicate)
Deprecated.instead useHttpResponseExpectation
along withFuture.expecting(Expectation)
List<ResponsePredicate>
expectations()
Deprecated.boolean
followRedirects()
HttpRequest<T>
followRedirects(boolean value)
io.vertx.ext.web.client.HttpRequest
getDelegate()
int
hashCode()
MultiMap
headers()
String
host()
HttpRequest<T>
host(String value)
long
idleTimeout()
HttpRequest<T>
idleTimeout(long timeout)
io.vertx.core.http.HttpMethod
method()
HttpRequest<T>
method(io.vertx.core.http.HttpMethod value)
boolean
multipartMixed()
HttpRequest<T>
multipartMixed(boolean allow)
static <T> HttpRequest<T>
newInstance(io.vertx.ext.web.client.HttpRequest arg)
static <T> HttpRequest<T>
newInstance(io.vertx.ext.web.client.HttpRequest arg, TypeArg<T> __typeArg_T)
int
port()
HttpRequest<T>
port(int value)
io.vertx.core.net.ProxyOptions
proxy()
HttpRequest<T>
proxy(io.vertx.core.net.ProxyOptions proxyOptions)
HttpRequest<T>
putHeader(String name, Iterable<String> value)
HttpRequest<T>
putHeader(String name, String value)
HttpRequest<T>
putHeaders(MultiMap headers)
MultiMap
queryParams()
io.smallrye.mutiny.Uni<HttpResponse<T>>
send()
Send a request, thehandler
will receive the response as anHttpResponse
.HttpResponse<T>
sendAndAwait()
Blocking variant ofsend()
.void
sendAndForget()
Variant ofsend()
that ignores the result of the operation.io.smallrye.mutiny.Uni<HttpResponse<T>>
sendBuffer(Buffer body)
Likesend()
but with an HTTP requestbody
buffer.HttpResponse<T>
sendBufferAndAwait(Buffer body)
Blocking variant ofsendBuffer(io.vertx.mutiny.core.buffer.Buffer)
.void
sendBufferAndForget(Buffer body)
Variant ofsendBuffer(io.vertx.mutiny.core.buffer.Buffer)
that ignores the result of the operation.io.smallrye.mutiny.Uni<HttpResponse<T>>
sendForm(MultiMap body)
Likesend()
but with an HTTP requestbody
multimap encoded as form and the content type set toapplication/x-www-form-urlencoded
.io.smallrye.mutiny.Uni<HttpResponse<T>>
sendForm(MultiMap body, String charset)
Likesend()
but with an HTTP requestbody
multimap encoded as form and the content type set toapplication/x-www-form-urlencoded
.HttpResponse<T>
sendFormAndAwait(MultiMap body)
Blocking variant ofsendForm(io.vertx.mutiny.core.MultiMap)
.HttpResponse<T>
sendFormAndAwait(MultiMap body, String charset)
Blocking variant ofsendForm(io.vertx.mutiny.core.MultiMap,String)
.void
sendFormAndForget(MultiMap body)
Variant ofsendForm(io.vertx.mutiny.core.MultiMap)
that ignores the result of the operation.void
sendFormAndForget(MultiMap body, String charset)
Variant ofsendForm(io.vertx.mutiny.core.MultiMap,String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<HttpResponse<T>>
sendJson(Object body)
Likesend()
but with an HTTP requestbody
object encoded as json and the content type set toapplication/json
.HttpResponse<T>
sendJsonAndAwait(Object body)
Blocking variant ofsendJson(Object)
.void
sendJsonAndForget(Object body)
Variant ofsendJson(Object)
that ignores the result of the operation.io.smallrye.mutiny.Uni<HttpResponse<T>>
sendJsonObject(io.vertx.core.json.JsonObject body)
Likesend()
but with an HTTP requestbody
object encoded as json and the content type set toapplication/json
.HttpResponse<T>
sendJsonObjectAndAwait(io.vertx.core.json.JsonObject body)
Blocking variant ofsendJsonObject(JsonObject)
.void
sendJsonObjectAndForget(io.vertx.core.json.JsonObject body)
Variant ofsendJsonObject(JsonObject)
that ignores the result of the operation.io.smallrye.mutiny.Uni<HttpResponse<T>>
sendMultipartForm(MultipartForm body)
Likesend()
but with an HTTP requestbody
multimap encoded as form and the content type set tomultipart/form-data
.HttpResponse<T>
sendMultipartFormAndAwait(MultipartForm body)
Blocking variant ofsendMultipartForm(io.vertx.mutiny.ext.web.multipart.MultipartForm)
.void
sendMultipartFormAndForget(MultipartForm body)
Variant ofsendMultipartForm(io.vertx.mutiny.ext.web.multipart.MultipartForm)
that ignores the result of the operation.io.smallrye.mutiny.Uni<HttpResponse<T>>
sendStream(ReadStream<Buffer> body)
Likesend()
but with an HTTP requestbody
stream.io.smallrye.mutiny.Uni<HttpResponse<T>>
sendStream(Flow.Publisher<Buffer> body)
Likesend()
but with an HTTP requestbody
stream.HttpResponse<T>
sendStreamAndAwait(ReadStream<Buffer> body)
Blocking variant ofsendStream(io.vertx.mutiny.core.streams.ReadStream)
.HttpResponse<T>
sendStreamAndAwait(Flow.Publisher<Buffer> body)
Blocking variant ofio.vertx.mutiny.ext.web.client.HttpRequest#sendStream(Flow$Publisher)
.void
sendStreamAndForget(ReadStream<Buffer> body)
Variant ofsendStream(io.vertx.mutiny.core.streams.ReadStream)
that ignores the result of the operation.void
sendStreamAndForget(Flow.Publisher<Buffer> body)
Variant ofio.vertx.mutiny.ext.web.client.HttpRequest#sendStream(Flow$Publisher)
that ignores the result of the operation.HttpRequest<T>
setQueryParam(String paramName, String paramValue)
HttpRequest<T>
setTemplateParam(String paramName, String paramValue)
HttpRequest<T>
setTemplateParam(String paramName, List<String> paramValue)
HttpRequest<T>
setTemplateParam(String paramName, Map<String,String> paramValue)
Boolean
ssl()
HttpRequest<T>
ssl(Boolean value)
Variables
templateParams()
long
timeout()
HttpRequest<T>
timeout(long value)
String
toString()
String
traceOperation()
HttpRequest<T>
traceOperation(String traceOperation)
String
uri()
HttpRequest<T>
uri(String value)
String
virtualHost()
HttpRequest<T>
virtualHost(String value)
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<HttpRequest> __TYPE_ARG
-
-
Method Detail
-
getDelegate
public io.vertx.ext.web.client.HttpRequest getDelegate()
-
method
public HttpRequest<T> method(io.vertx.core.http.HttpMethod value)
- Parameters:
value
-- Returns:
- a reference to this, so the API can be used fluently
-
method
public io.vertx.core.http.HttpMethod method()
- Returns:
- the request method
-
port
public HttpRequest<T> port(int value)
- Parameters:
value
-- Returns:
- a reference to this, so the API can be used fluently
-
port
public int port()
- Returns:
- the request port or
0
when none is set for absolute URI templates
-
as
public <U> HttpRequest<U> as(BodyCodec<U> responseCodec)
- Parameters:
responseCodec
- the response codec- Returns:
- a reference to this, so the API can be used fluently
-
host
public HttpRequest<T> host(String value)
- Parameters:
value
-- Returns:
- a reference to this, so the API can be used fluently
-
host
public String host()
- Returns:
- the request host or
null
when none is set for absolute URI templates
-
virtualHost
public HttpRequest<T> virtualHost(String value)
- Parameters:
value
-- Returns:
- a reference to this, so the API can be used fluently
-
virtualHost
public String virtualHost()
- Returns:
- the request virtual host if any or
null
-
uri
public HttpRequest<T> uri(String value)
- Parameters:
value
-- Returns:
- a reference to this, so the API can be used fluently
-
uri
public String uri()
- Returns:
- the request uri or
null
when none is set for absolute URI templates
-
putHeaders
public HttpRequest<T> putHeaders(MultiMap headers)
- Parameters:
headers
- The HTTP headers- Returns:
- a reference to this, so the API can be used fluently
-
putHeader
public HttpRequest<T> putHeader(String name, String value)
- Parameters:
name
- the header namevalue
- the header value- Returns:
- a reference to this, so the API can be used fluently
-
headers
public MultiMap headers()
- Returns:
- The HTTP headers
-
basicAuthentication
public HttpRequest<T> basicAuthentication(String id, String password)
- Parameters:
id
- the idpassword
- the password- Returns:
- a reference to this, so the API can be used fluently
-
basicAuthentication
public HttpRequest<T> basicAuthentication(Buffer id, Buffer password)
- Parameters:
id
- the idpassword
- the password- Returns:
- a reference to this, so the API can be used fluently
-
bearerTokenAuthentication
public HttpRequest<T> bearerTokenAuthentication(String bearerToken)
- Parameters:
bearerToken
- the bearer token- Returns:
- a reference to this, so the API can be used fluently
-
ssl
public HttpRequest<T> ssl(Boolean value)
- Parameters:
value
-- Returns:
- a reference to this, so the API can be used fluently
-
ssl
public Boolean ssl()
- Returns:
- whether the request uses SSL or
null
when none is set for absolute URI templates
-
timeout
public HttpRequest<T> timeout(long value)
- Parameters:
value
-- Returns:
- the instance of HttpRequest
to chain method calls.
-
timeout
public long timeout()
- Returns:
- the current timeout in milliseconds
-
idleTimeout
public HttpRequest<T> idleTimeout(long timeout)
- Parameters:
timeout
- the amount of time in milliseconds.- Returns:
- a reference to this, so the API can be used fluently
-
idleTimeout
public long idleTimeout()
- Returns:
- the idle timeout in milliseconds
-
connectTimeout
public HttpRequest<T> connectTimeout(long timeout)
- Parameters:
timeout
- the amount of time in milliseconds.- Returns:
- a reference to this, so the API can be used fluently
-
connectTimeout
public long connectTimeout()
- Returns:
- the connect timeout in milliseconds
-
addQueryParam
public HttpRequest<T> addQueryParam(String paramName, String paramValue)
- Parameters:
paramName
- the param nameparamValue
- the param value- Returns:
- a reference to this, so the API can be used fluently
-
setQueryParam
public HttpRequest<T> setQueryParam(String paramName, String paramValue)
- Parameters:
paramName
- the param nameparamValue
- the param value- Returns:
- a reference to this, so the API can be used fluently
-
setTemplateParam
public HttpRequest<T> setTemplateParam(String paramName, String paramValue)
- Parameters:
paramName
- the param nameparamValue
- the param value- Returns:
- a reference to this, so the API can be used fluently
-
setTemplateParam
public HttpRequest<T> setTemplateParam(String paramName, List<String> paramValue)
- Parameters:
paramName
- the param nameparamValue
- the param value- Returns:
- a reference to this, so the API can be used fluently
-
setTemplateParam
public HttpRequest<T> setTemplateParam(String paramName, Map<String,String> paramValue)
- Parameters:
paramName
- the param nameparamValue
- the param value- Returns:
- a reference to this, so the API can be used fluently
-
followRedirects
public HttpRequest<T> followRedirects(boolean value)
- Parameters:
value
- true if redirections should be followed- Returns:
- a reference to this, so the API can be used fluently
-
followRedirects
public boolean followRedirects()
- Returns:
- whether to follow request redirections
-
proxy
public HttpRequest<T> proxy(io.vertx.core.net.ProxyOptions proxyOptions)
- Parameters:
proxyOptions
- The proxy options- Returns:
- a reference to this, so the API can be used fluently
-
proxy
public io.vertx.core.net.ProxyOptions proxy()
- Returns:
- the proxy for this request
-
expect
@Deprecated public HttpRequest<T> expect(Function<HttpResponse<Void>,ResponsePredicateResult> predicate)
Deprecated.instead useHttpResponseExpectation
along withFuture.expecting(Expectation)
- Parameters:
predicate
- the predicate- Returns:
- a reference to this, so the API can be used fluently
-
expect
@Deprecated public HttpRequest<T> expect(ResponsePredicate predicate)
Deprecated.instead useHttpResponseExpectation
along withFuture.expecting(Expectation)
- Parameters:
predicate
- the predicate- Returns:
- a reference to this, so the API can be used fluently
-
expectations
@Deprecated public List<ResponsePredicate> expectations()
Deprecated.- Returns:
- a read-only list of the response predicate expectations
-
queryParams
public MultiMap queryParams()
- Returns:
- the current query parameters
-
templateParams
public Variables templateParams()
- Returns:
- the current request URI template parameters
-
copy
public HttpRequest<T> copy()
- Returns:
- a copy of this request
-
multipartMixed
public HttpRequest<T> multipartMixed(boolean allow)
- Parameters:
allow
-true
allows use of multipart mixed encoding- Returns:
- a reference to this, so the API can be used fluently
-
multipartMixed
public boolean multipartMixed()
- Returns:
- whether multipart mixed encoding is allowed
-
traceOperation
public HttpRequest<T> traceOperation(String traceOperation)
- Parameters:
traceOperation
- Name of operation to use in traces- Returns:
- a reference to this, so the API can be used fluently
-
traceOperation
public String traceOperation()
- Returns:
- the trace operation name override
-
sendStream
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendStream(ReadStream<Buffer> body)
Likesend()
but with an HTTP requestbody
stream.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
body
- the body- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendStreamAndAwait
public HttpResponse<T> sendStreamAndAwait(ReadStream<Buffer> body)
Blocking variant ofsendStream(io.vertx.mutiny.core.streams.ReadStream)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
body
- the body- Returns:
- the HttpResponse
instance produced by the operation.
-
sendStreamAndForget
public void sendStreamAndForget(ReadStream<Buffer> body)
Variant ofsendStream(io.vertx.mutiny.core.streams.ReadStream)
that ignores the result of the operation.This method subscribes on the result of
sendStream(io.vertx.mutiny.core.streams.ReadStream)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsendStream(io.vertx.mutiny.core.streams.ReadStream)
but you don't need to compose it with other operations.- Parameters:
body
- the body
-
sendStream
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendStream(Flow.Publisher<Buffer> body)
Likesend()
but with an HTTP requestbody
stream.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
body
- the body- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendStreamAndAwait
public HttpResponse<T> sendStreamAndAwait(Flow.Publisher<Buffer> body)
Blocking variant ofio.vertx.mutiny.ext.web.client.HttpRequest#sendStream(Flow$Publisher)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
body
- the body- Returns:
- the HttpResponse
instance produced by the operation.
-
sendStreamAndForget
public void sendStreamAndForget(Flow.Publisher<Buffer> body)
Variant ofio.vertx.mutiny.ext.web.client.HttpRequest#sendStream(Flow$Publisher)
that ignores the result of the operation.This method subscribes on the result of
io.vertx.mutiny.ext.web.client.HttpRequest#sendStream(Flow$Publisher)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromio.vertx.mutiny.ext.web.client.HttpRequest#sendStream(Flow$Publisher)
but you don't need to compose it with other operations.- Parameters:
body
- the body
-
sendBuffer
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendBuffer(Buffer body)
Likesend()
but with an HTTP requestbody
buffer.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
body
- the body- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendBufferAndAwait
public HttpResponse<T> sendBufferAndAwait(Buffer body)
Blocking variant ofsendBuffer(io.vertx.mutiny.core.buffer.Buffer)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
body
- the body- Returns:
- the HttpResponse
instance produced by the operation.
-
sendBufferAndForget
public void sendBufferAndForget(Buffer body)
Variant ofsendBuffer(io.vertx.mutiny.core.buffer.Buffer)
that ignores the result of the operation.This method subscribes on the result of
sendBuffer(io.vertx.mutiny.core.buffer.Buffer)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsendBuffer(io.vertx.mutiny.core.buffer.Buffer)
but you don't need to compose it with other operations.- Parameters:
body
- the body
-
sendJsonObject
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendJsonObject(io.vertx.core.json.JsonObject body)
Likesend()
but with an HTTP requestbody
object encoded as json and the content type set toapplication/json
.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
body
- the body- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendJsonObjectAndAwait
public HttpResponse<T> sendJsonObjectAndAwait(io.vertx.core.json.JsonObject body)
Blocking variant ofsendJsonObject(JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
body
- the body- Returns:
- the HttpResponse
instance produced by the operation.
-
sendJsonObjectAndForget
public void sendJsonObjectAndForget(io.vertx.core.json.JsonObject body)
Variant ofsendJsonObject(JsonObject)
that ignores the result of the operation.This method subscribes on the result of
sendJsonObject(JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsendJsonObject(JsonObject)
but you don't need to compose it with other operations.- Parameters:
body
- the body
-
sendJson
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendJson(Object body)
Likesend()
but with an HTTP requestbody
object encoded as json and the content type set toapplication/json
.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
body
- the body- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendJsonAndAwait
public HttpResponse<T> sendJsonAndAwait(Object body)
Blocking variant ofsendJson(Object)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
body
- the body- Returns:
- the HttpResponse
instance produced by the operation.
-
sendJsonAndForget
public void sendJsonAndForget(Object body)
Variant ofsendJson(Object)
that ignores the result of the operation.This method subscribes on the result of
sendJson(Object)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsendJson(Object)
but you don't need to compose it with other operations.- Parameters:
body
- the body
-
sendForm
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendForm(MultiMap body)
Likesend()
but with an HTTP requestbody
multimap encoded as form and the content type set toapplication/x-www-form-urlencoded
.When the content type header is previously set to
multipart/form-data
it will be used instead.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
body
- the body- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendFormAndAwait
public HttpResponse<T> sendFormAndAwait(MultiMap body)
Blocking variant ofsendForm(io.vertx.mutiny.core.MultiMap)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
body
- the body- Returns:
- the HttpResponse
instance produced by the operation.
-
sendFormAndForget
public void sendFormAndForget(MultiMap body)
Variant ofsendForm(io.vertx.mutiny.core.MultiMap)
that ignores the result of the operation.This method subscribes on the result of
sendForm(io.vertx.mutiny.core.MultiMap)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsendForm(io.vertx.mutiny.core.MultiMap)
but you don't need to compose it with other operations.- Parameters:
body
- the body
-
sendForm
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendForm(MultiMap body, String charset)
Likesend()
but with an HTTP requestbody
multimap encoded as form and the content type set toapplication/x-www-form-urlencoded
.When the content type header is previously set to
multipart/form-data
it will be used instead. NOTE: the use of this method is strongly discouraged to use when the form is aapplication/x-www-form-urlencoded
encoded form since the charset to use must be UTF-8.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
body
- the bodycharset
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendFormAndAwait
public HttpResponse<T> sendFormAndAwait(MultiMap body, String charset)
Blocking variant ofsendForm(io.vertx.mutiny.core.MultiMap,String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
body
- the bodycharset
-- Returns:
- the HttpResponse
instance produced by the operation.
-
sendFormAndForget
public void sendFormAndForget(MultiMap body, String charset)
Variant ofsendForm(io.vertx.mutiny.core.MultiMap,String)
that ignores the result of the operation.This method subscribes on the result of
sendForm(io.vertx.mutiny.core.MultiMap,String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsendForm(io.vertx.mutiny.core.MultiMap,String)
but you don't need to compose it with other operations.- Parameters:
body
- the bodycharset
-
-
sendMultipartForm
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendMultipartForm(MultipartForm body)
Likesend()
but with an HTTP requestbody
multimap encoded as form and the content type set tomultipart/form-data
. You may use this method to send attributes and upload files.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
body
- the body- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendMultipartFormAndAwait
public HttpResponse<T> sendMultipartFormAndAwait(MultipartForm body)
Blocking variant ofsendMultipartForm(io.vertx.mutiny.ext.web.multipart.MultipartForm)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
body
- the body- Returns:
- the HttpResponse
instance produced by the operation.
-
sendMultipartFormAndForget
public void sendMultipartFormAndForget(MultipartForm body)
Variant ofsendMultipartForm(io.vertx.mutiny.ext.web.multipart.MultipartForm)
that ignores the result of the operation.This method subscribes on the result of
sendMultipartForm(io.vertx.mutiny.ext.web.multipart.MultipartForm)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsendMultipartForm(io.vertx.mutiny.ext.web.multipart.MultipartForm)
but you don't need to compose it with other operations.- Parameters:
body
- the body
-
send
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> send()
Send a request, thehandler
will receive the response as anHttpResponse
.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendAndAwait
public HttpResponse<T> sendAndAwait()
Blocking variant ofsend()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the HttpResponse
instance produced by the operation.
-
sendAndForget
public void sendAndForget()
-
putHeader
public HttpRequest<T> putHeader(String name, Iterable<String> value)
- Parameters:
name
- the header namevalue
- the header value- Returns:
- a reference to this, so the API can be used fluently
-
authentication
public HttpRequest<T> authentication(io.vertx.ext.auth.authentication.Credentials credentials)
- Parameters:
credentials
- the credentials to use.- Returns:
- a reference to this, so the API can be used fluently
-
newInstance
public static <T> HttpRequest<T> newInstance(io.vertx.ext.web.client.HttpRequest arg)
-
newInstance
public static <T> HttpRequest<T> newInstance(io.vertx.ext.web.client.HttpRequest arg, TypeArg<T> __typeArg_T)
-
-