Class HttpRequest<T>
- Type Parameters:
T- the type of response body
- All Implemented Interfaces:
MutinyDelegate
Instances are created by an WebClient instance, via one of the methods corresponding to the specific
HTTP methods such as WebClient.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
can be called. ThesendXXX 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
HttpResponseinstance 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 BodyCodec is used
such as BodyCodec#create(Handler).
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Julien Viet
- See Also:
-
HttpRequest
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpRequest(io.vertx.ext.web.client.HttpRequest<T> delegate) Create a new instance ofHttpRequestdelegating to the given (non-null) instance ofHttpRequest.HttpRequest(io.vertx.ext.web.client.HttpRequest<T> delegate, TypeArg<T> typeArg_0) HttpRequest(Object delegate, TypeArg<T> typeArg_0) -
Method Summary
Modifier and TypeMethodDescriptionaddQueryParam(String paramName, String paramValue) Add a query parameter to the request.<U> HttpRequest<U>Configure the request to decode the response with theresponseCodec.authentication(io.vertx.ext.auth.authentication.Credentials credentials) Configure the request to perform HTTP Authentication.basicAuthentication(io.vertx.core.buffer.Buffer id, io.vertx.core.buffer.Buffer password) Configure the request to perform basic access authentication.basicAuthentication(String id, String password) Configure the request to perform basic access authentication.bearerTokenAuthentication(String bearerToken) Configure the request to perform bearer token authentication.longconnectTimeout(long timeout) Sets the amount of time after which, if the request is not obtained from the client within the timeout period, the response is failed with aTimeoutException.copy()Copy this requestbooleanbooleanfollowRedirects(boolean value) Set whether to follow request redirectionsio.vertx.ext.web.client.HttpRequest<T>Get the delegate instance.inthashCode()io.vertx.core.MultiMapheaders()host()Configure the request to use a new hostvalue.longidleTimeout(long timeout) Sets the amount of time after which, if the request does not return any data within the timeout period, the request/response is closed and the related futures are failed with aTimeoutException.io.vertx.core.http.HttpMethodmethod()method(io.vertx.core.http.HttpMethod value) Configure the request to use a new methodvalue.booleanmultipartMixed(boolean allow) Allow or disallow multipart mixed encoding when sendingMultipartFormhaving files sharing the same file name.static <T> HttpRequest<T>newInstance(io.vertx.ext.web.client.HttpRequest<T> delegate) Creates a new instance of theHttpRequest.static <T> HttpRequest<T>newInstance(io.vertx.ext.web.client.HttpRequest<T> delegate, TypeArg<T> typeArg_0) Creates a new instance of theHttpRequest.intport()port(int value) Configure the request to use a new portvalue.io.vertx.core.net.ProxyOptionsproxy()proxy(io.vertx.core.net.ProxyOptions proxyOptions) Configure the request to set a proxy for this request.putHeader(CharSequence name, CharSequence value) Configure the request to set a new HTTP header usingCharSequence.putHeader(CharSequence name, Iterable<CharSequence> values) Configure the request to set a new HTTP header with multiple values usingCharSequence.Configure the request to set a new HTTP header with multiple values.Configure the request to set a new HTTP header.putHeaders(io.vertx.core.MultiMap headers) Configure the request to add multiple HTTP headers .io.vertx.core.MultiMapReturn the current query parameters.Return the routing key, the routing key can be used by a Vert.x client side sticky load balancer to pin the request to a remote HTTP server.routingKey(String key) Set the routing key, the routing key can be used by a Vert.x client side sticky load balancer to pin the request to a remote HTTP server.io.smallrye.mutiny.Uni<HttpResponse<T>>send()Send a request, thehandlerwill receive the response as anHttpResponse.Send a request, thehandlerwill receive the response as anHttpResponse.Send a request, thehandlerwill receive the response as anHttpResponse.io.smallrye.mutiny.Uni<HttpResponse<T>>sendBuffer(io.vertx.core.buffer.Buffer body) Likesend()but with an HTTP requestbodybuffer.sendBufferAndAwait(io.vertx.core.buffer.Buffer body) Likesend()but with an HTTP requestbodybuffer.sendBufferAndForget(io.vertx.core.buffer.Buffer body) Likesend()but with an HTTP requestbodybuffer.io.smallrye.mutiny.Uni<HttpResponse<T>>sendForm(io.vertx.core.MultiMap body) Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set toapplication/x-www-form-urlencoded.io.smallrye.mutiny.Uni<HttpResponse<T>>Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set toapplication/x-www-form-urlencoded.sendFormAndAwait(io.vertx.core.MultiMap body) Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set toapplication/x-www-form-urlencoded.sendFormAndAwait(io.vertx.core.MultiMap body, String charset) Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set toapplication/x-www-form-urlencoded.sendFormAndForget(io.vertx.core.MultiMap body) Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set toapplication/x-www-form-urlencoded.sendFormAndForget(io.vertx.core.MultiMap body, String charset) Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set toapplication/x-www-form-urlencoded.io.smallrye.mutiny.Uni<HttpResponse<T>>Likesend()but with an HTTP requestbodyobject encoded as json and the content type set toapplication/json.sendJsonAndAwait(Object body) Likesend()but with an HTTP requestbodyobject encoded as json and the content type set toapplication/json.sendJsonAndForget(Object body) Likesend()but with an HTTP requestbodyobject encoded as json and the content type set toapplication/json.io.smallrye.mutiny.Uni<HttpResponse<T>>sendJsonObject(io.vertx.core.json.JsonObject body) Likesend()but with an HTTP requestbodyobject encoded as json and the content type set toapplication/json.sendJsonObjectAndAwait(io.vertx.core.json.JsonObject body) Likesend()but with an HTTP requestbodyobject encoded as json and the content type set toapplication/json.sendJsonObjectAndForget(io.vertx.core.json.JsonObject body) Likesend()but with an HTTP requestbodyobject encoded as json and the content type set toapplication/json.io.smallrye.mutiny.Uni<HttpResponse<T>>Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set tomultipart/form-data.Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set tomultipart/form-data.Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set tomultipart/form-data.io.smallrye.mutiny.Uni<HttpResponse<T>>sendStream(ReadStream<io.vertx.core.buffer.Buffer> body) Likesend()but with an HTTP requestbodystream.io.smallrye.mutiny.Uni<HttpResponse<T>>sendStream(Flow.Publisher<io.vertx.core.buffer.Buffer> body) Likesend()but with an HTTP requestbodystream.sendStreamAndAwait(ReadStream<io.vertx.core.buffer.Buffer> body) Likesend()but with an HTTP requestbodystream.sendStreamAndAwait(Flow.Publisher<io.vertx.core.buffer.Buffer> body) Likesend()but with an HTTP requestbodystream.sendStreamAndForget(ReadStream<io.vertx.core.buffer.Buffer> body) Likesend()but with an HTTP requestbodystream.sendStreamAndForget(Flow.Publisher<io.vertx.core.buffer.Buffer> body) Likesend()but with an HTTP requestbodystream.setQueryParam(String paramName, String paramValue) Set a query parameter to the request.setTemplateParam(String paramName, String paramValue) Set a request URI template string parameter to the request, expanded when the request URI is aUriTemplate.setTemplateParam(String paramName, List<String> paramValue) Set a request URI template list parameter to the request, expanded when the request URI is aUriTemplate.setTemplateParam(String paramName, Map<String, String> paramValue) Set a request URI template map parameter to the request, expanded when the request URI is aUriTemplate.ssl()Configure the request whether to use SSL.Return the current request URI template parameters.longtimeout()timeout(long value) Configures the amount of time in milliseconds after which if the request does not return any data within the timeout period anTimeoutExceptionfails the request.toString()traceOperation(String traceOperation) Trace operation name override.uri()Configure the request to use a new request URIvalue.virtualHost(String value) Configure the request to use a virtual hostvalue.
-
Field Details
-
__TYPE_ARG
-
__typeArg_0
-
-
Constructor Details
-
HttpRequest
Create a new instance ofHttpRequestdelegating to the given (non-null) instance ofHttpRequest. -
HttpRequest
-
HttpRequest
-
-
Method Details
-
getDelegate
Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
sendStream
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendStream(ReadStream<io.vertx.core.buffer.Buffer> body) Likesend()but with an HTTP requestbodystream.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
body- the body- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
sendStream(ReadStream)io.vertx.ext.web.client.HttpRequest#sendStream(ReadStream)
-
sendStreamAndAwait
Likesend()but with an HTTP requestbodystream.Unlike the bare Vert.x variant, this method returns a
HttpResponse<T>. This method awaits indefinitely 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 aRuntimeException).- Parameters:
body- the body- Returns:
- The operation result
- See Also:
-
sendStream(ReadStream)io.vertx.ext.web.client.HttpRequest#sendStream(ReadStream)
-
sendStreamAndForget
Likesend()but with an HTTP requestbodystream.Unlike the bare Vert.x variant, this method ignores the
HttpResponse<T>result or any failure.- Parameters:
body- the body- Returns:
- The current instance to chain operations if needed.
- See Also:
-
sendStream(ReadStream)io.vertx.ext.web.client.HttpRequest#sendStream(ReadStream)
-
sendStream
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendStream(Flow.Publisher<io.vertx.core.buffer.Buffer> body) Likesend()but with an HTTP requestbodystream.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
body- the body- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
sendStream(ReadStream)io.vertx.ext.web.client.HttpRequest#sendStream(ReadStream)
-
sendStreamAndAwait
Likesend()but with an HTTP requestbodystream.Unlike the bare Vert.x variant, this method returns a
HttpResponse<T>. This method awaits indefinitely 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 aRuntimeException).- Parameters:
body- the body- Returns:
- The operation result
- See Also:
-
sendStream(ReadStream)io.vertx.ext.web.client.HttpRequest#sendStream(ReadStream)
-
sendStreamAndForget
Likesend()but with an HTTP requestbodystream.Unlike the bare Vert.x variant, this method ignores the
HttpResponse<T>result or any failure.- Parameters:
body- the body- Returns:
- The current instance to chain operations if needed.
- See Also:
-
sendStream(ReadStream)io.vertx.ext.web.client.HttpRequest#sendStream(ReadStream)
-
sendBuffer
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendBuffer(io.vertx.core.buffer.Buffer body) Likesend()but with an HTTP requestbodybuffer.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
body- the body- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
sendBuffer(Buffer)HttpRequest.sendBuffer(Buffer)
-
sendBufferAndAwait
Likesend()but with an HTTP requestbodybuffer.Unlike the bare Vert.x variant, this method returns a
HttpResponse<T>. This method awaits indefinitely 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 aRuntimeException).- Parameters:
body- the body- Returns:
- The operation result
- See Also:
-
sendBuffer(Buffer)HttpRequest.sendBuffer(Buffer)
-
sendBufferAndForget
Likesend()but with an HTTP requestbodybuffer.Unlike the bare Vert.x variant, this method ignores the
HttpResponse<T>result or any failure.- Parameters:
body- the body- Returns:
- The current instance to chain operations if needed.
- See Also:
-
sendBuffer(Buffer)HttpRequest.sendBuffer(Buffer)
-
sendJsonObject
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendJsonObject(io.vertx.core.json.JsonObject body) Likesend()but with an HTTP requestbodyobject encoded as json and the content type set toapplication/json.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
body- the body- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
sendJsonObject(JsonObject)HttpRequest.sendJsonObject(JsonObject)
-
sendJsonObjectAndAwait
Likesend()but with an HTTP requestbodyobject encoded as json and the content type set toapplication/json.Unlike the bare Vert.x variant, this method returns a
HttpResponse<T>. This method awaits indefinitely 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 aRuntimeException).- Parameters:
body- the body- Returns:
- The operation result
- See Also:
-
sendJsonObject(JsonObject)HttpRequest.sendJsonObject(JsonObject)
-
sendJsonObjectAndForget
Likesend()but with an HTTP requestbodyobject encoded as json and the content type set toapplication/json.Unlike the bare Vert.x variant, this method ignores the
HttpResponse<T>result or any failure.- Parameters:
body- the body- Returns:
- The current instance to chain operations if needed.
- See Also:
-
sendJsonObject(JsonObject)HttpRequest.sendJsonObject(JsonObject)
-
sendJson
Likesend()but with an HTTP requestbodyobject encoded as json and the content type set toapplication/json.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
body- the body. Can benull.- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
sendJson(Object)HttpRequest.sendJson(Object)
-
sendJsonAndAwait
Likesend()but with an HTTP requestbodyobject encoded as json and the content type set toapplication/json.Unlike the bare Vert.x variant, this method returns a
HttpResponse<T>. This method awaits indefinitely 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 aRuntimeException).- Parameters:
body- the body- Returns:
- The operation result
- See Also:
-
sendJson(Object)HttpRequest.sendJson(Object)
-
sendJsonAndForget
Likesend()but with an HTTP requestbodyobject encoded as json and the content type set toapplication/json.Unlike the bare Vert.x variant, this method ignores the
HttpResponse<T>result or any failure.- Parameters:
body- the body- Returns:
- The current instance to chain operations if needed.
- See Also:
-
sendJson(Object)HttpRequest.sendJson(Object)
-
sendForm
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendForm(io.vertx.core.MultiMap body) Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set toapplication/x-www-form-urlencoded.When the content type header is previously set to
multipart/form-datait will be used instead.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
body- the body- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
sendForm(MultiMap)HttpRequest.sendForm(MultiMap)
-
sendFormAndAwait
Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set toapplication/x-www-form-urlencoded.When the content type header is previously set to
multipart/form-datait will be used instead.Unlike the bare Vert.x variant, this method returns a
HttpResponse<T>. This method awaits indefinitely 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 aRuntimeException).- Parameters:
body- the body- Returns:
- The operation result
- See Also:
-
sendForm(MultiMap)HttpRequest.sendForm(MultiMap)
-
sendFormAndForget
Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set toapplication/x-www-form-urlencoded.When the content type header is previously set to
multipart/form-datait will be used instead.Unlike the bare Vert.x variant, this method ignores the
HttpResponse<T>result or any failure.- Parameters:
body- the body- Returns:
- The current instance to chain operations if needed.
- See Also:
-
sendForm(MultiMap)HttpRequest.sendForm(MultiMap)
-
sendForm
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendForm(io.vertx.core.MultiMap body, String charset) Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set toapplication/x-www-form-urlencoded.When the content type header is previously set to
multipart/form-datait will be used instead. NOTE: the use of this method is strongly discouraged to use when the form is aapplication/x-www-form-urlencodedencoded form since the charset to use must be UTF-8.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
body- the bodycharset- the charset- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
sendForm(MultiMap, String)HttpRequest.sendForm(MultiMap, String)
-
sendFormAndAwait
Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set toapplication/x-www-form-urlencoded.When the content type header is previously set to
multipart/form-datait will be used instead. NOTE: the use of this method is strongly discouraged to use when the form is aapplication/x-www-form-urlencodedencoded form since the charset to use must be UTF-8.Unlike the bare Vert.x variant, this method returns a
HttpResponse<T>. This method awaits indefinitely 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 aRuntimeException).- Parameters:
body- the bodycharset- the charset- Returns:
- The operation result
- See Also:
-
sendForm(MultiMap, String)HttpRequest.sendForm(MultiMap, String)
-
sendFormAndForget
Likesend()but with an HTTP requestbodymultimap encoded as form and the content type set toapplication/x-www-form-urlencoded.When the content type header is previously set to
multipart/form-datait will be used instead. NOTE: the use of this method is strongly discouraged to use when the form is aapplication/x-www-form-urlencodedencoded form since the charset to use must be UTF-8.Unlike the bare Vert.x variant, this method ignores the
HttpResponse<T>result or any failure.- Parameters:
body- the bodycharset- the charset- Returns:
- The current instance to chain operations if needed.
- See Also:
-
sendForm(MultiMap, String)HttpRequest.sendForm(MultiMap, String)
-
sendMultipartForm
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpResponse<T>> sendMultipartForm(MultipartForm body) Likesend()but with an HTTP requestbodymultimap 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. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
body- the body- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
sendMultipartForm(MultipartForm)io.vertx.ext.web.client.HttpRequest#sendMultipartForm(MultipartForm)
-
sendMultipartFormAndAwait
Likesend()but with an HTTP requestbodymultimap 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
HttpResponse<T>. This method awaits indefinitely 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 aRuntimeException).- Parameters:
body- the body- Returns:
- The operation result
- See Also:
-
sendMultipartForm(MultipartForm)io.vertx.ext.web.client.HttpRequest#sendMultipartForm(MultipartForm)
-
sendMultipartFormAndForget
Likesend()but with an HTTP requestbodymultimap 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 ignores the
HttpResponse<T>result or any failure.- Parameters:
body- the body- Returns:
- The current instance to chain operations if needed.
- See Also:
-
sendMultipartForm(MultipartForm)io.vertx.ext.web.client.HttpRequest#sendMultipartForm(MultipartForm)
-
send
Send a request, thehandlerwill receive the response as anHttpResponse.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
send()HttpRequest.send()
-
sendAndAwait
Send a request, thehandlerwill receive the response as anHttpResponse.Unlike the bare Vert.x variant, this method returns a
HttpResponse<T>. This method awaits indefinitely 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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
send()HttpRequest.send()
-
sendAndForget
Send a request, thehandlerwill receive the response as anHttpResponse.Unlike the bare Vert.x variant, this method ignores the
HttpResponse<T>result or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
send()HttpRequest.send()
-
method
Configure the request to use a new methodvalue.- 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
Configure the request to use a new portvalue.This overrides the port set by absolute URI requests
- Returns:
- a reference to this, so the API can be used fluently
-
port
public int port()- Returns:
- the request port or
0when none is set for absolute URI templates
-
as
Configure the request to decode the response with theresponseCodec.- Parameters:
responseCodec- the response codec- Returns:
- a reference to this, so the API can be used fluently
-
bodyCodec
- Returns:
- the request body codec
-
host
Configure the request to use a new hostvalue.This overrides the host set by absolute URI requests
- Returns:
- a reference to this, so the API can be used fluently
-
host
- Returns:
- the request host or
nullwhen none is set for absolute URI templates
-
virtualHost
Configure the request to use a virtual hostvalue. Usually the header host (:authority pseudo header for HTTP/2) is set from the request host value since this host value resolves to the server IP address. Sometimes you need to set a host header for an address that does not resolve to the server IP address. The virtual host value overrides the value of the actual host header (:authority pseudo header for HTTP/2). The virtual host is also be used for SNI.- Returns:
- a reference to this, so the API can be used fluently
-
virtualHost
- Returns:
- the request virtual host if any or
null
-
uri
Configure the request to use a new request URIvalue.This overrides the port set by absolute URI requests
When the uri has query parameters, they are set in the
queryParams(), overwriting any parameters previously set- Returns:
- a reference to this, so the API can be used fluently
-
uri
- Returns:
- the request uri or
nullwhen none is set for absolute URI templates, when the request uri is a template, the template is extrapolated tolerating missing variables.
-
putHeaders
Configure the request to add multiple HTTP headers .- Parameters:
headers- The HTTP headers- Returns:
- a reference to this, so the API can be used fluently
-
putHeader
Configure the request to set a new HTTP header.- Parameters:
name- the header namevalue- the header value- Returns:
- a reference to this, so the API can be used fluently
-
putHeader
Configure the request to set a new HTTP header usingCharSequence.This is an overload of
putHeader(String, String)that acceptsCharSequenceparameters.- Parameters:
name- the header namevalue- the header value- Returns:
- a reference to this, so the API can be used fluently
-
putHeader
Configure the request to set a new HTTP header with multiple values.- Parameters:
name- the header namevalue- the header value- Returns:
- a reference to this, so the API can be used fluently
-
putHeader
Configure the request to set a new HTTP header with multiple values usingCharSequence.This is an overload of
putHeader(String, Iterable)that acceptsCharSequenceparameters.- Parameters:
name- the header namevalues- the header values- Returns:
- a reference to this, so the API can be used fluently
-
headers
public io.vertx.core.MultiMap headers()- Returns:
- The HTTP headers
-
authentication
Configure the request to perform HTTP Authentication.Performs a generic authentication using the credentials provided by the user. For the sake of validation safety it is recommended that
Credentials.applyHttpChallenge(String)is called to ensure that the credentials are applicable to the HTTP Challenged received on a previous request that returned a 401 response code.- Parameters:
credentials- the credentials to use.- Returns:
- a reference to this, so the API can be used fluently
-
basicAuthentication
Configure the request to perform basic access authentication.In basic HTTP authentication, a request contains a header field of the form 'Authorization: Basic <credentials>', where credentials is the base64 encoding of id and password joined by a colon.
In practical terms the arguments are converted to aUsernamePasswordCredentialsobject.- Parameters:
id- the idpassword- the password- Returns:
- a reference to this, so the API can be used fluently
-
basicAuthentication
public HttpRequest<T> basicAuthentication(io.vertx.core.buffer.Buffer id, io.vertx.core.buffer.Buffer password) Configure the request to perform basic access authentication.In basic HTTP authentication, a request contains a header field of the form 'Authorization: Basic <credentials>', where credentials is the base64 encoding of id and password joined by a colon.
In practical terms the arguments are converted to aUsernamePasswordCredentialsobject.- Parameters:
id- the idpassword- the password- Returns:
- a reference to this, so the API can be used fluently
-
bearerTokenAuthentication
Configure the request to perform bearer token authentication.In OAuth 2.0, a request contains a header field of the form 'Authorization: Bearer <bearerToken>', where bearerToken is the bearer token issued by an authorization server to access protected resources.
In practical terms the arguments are converted to aTokenCredentialsobject.- Parameters:
bearerToken- the bearer token- Returns:
- a reference to this, so the API can be used fluently
-
ssl
Configure the request whether to use SSL.This overrides the SSL value set by absolute URI requests
- Returns:
- a reference to this, so the API can be used fluently
-
ssl
- Returns:
- whether the request uses SSL or
nullwhen none is set for absolute URI templates
-
timeout
Configures the amount of time in milliseconds after which if the request does not return any data within the timeout period anTimeoutExceptionfails the request.Setting zero or a negative
valuedisables the timeout.- Parameters:
value- The quantity of time in milliseconds.- Returns:
- a reference to this, so the API can be used fluently
-
timeout
public long timeout()- Returns:
- the current timeout in milliseconds
-
idleTimeout
Sets the amount of time after which, if the request does not return any data within the timeout period, the request/response is closed and the related futures are failed with aTimeoutException. The timeout starts after a connection is obtained from the client.- 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
-
connectTimeout
Sets the amount of time after which, if the request is not obtained from the client within the timeout period, the response is failed with aTimeoutException. Note this is not related to the TCPHttpClientOptions#setConnectTimeout(int)option, when a request is made against a pooled HTTP client, the timeout applies to the duration to obtain a connection from the pool to serve the request, the timeout might fire because the server does not respond in time or the pool is too busy to serve a request.- 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
-
addQueryParam
Add a query parameter to the request.- Parameters:
paramName- the param nameparamValue- the param value- Returns:
- a reference to this, so the API can be used fluently
-
setQueryParam
Set a query parameter to the request.- Parameters:
paramName- the param nameparamValue- the param value- Returns:
- a reference to this, so the API can be used fluently
-
setTemplateParam
Set a request URI template string parameter to the request, expanded when the request URI is aUriTemplate.- Parameters:
paramName- the param nameparamValue- the param value- Returns:
- a reference to this, so the API can be used fluently
-
setTemplateParam
Set a request URI template list parameter to the request, expanded when the request URI is aUriTemplate.- Parameters:
paramName- the param nameparamValue- the param value- Returns:
- a reference to this, so the API can be used fluently
-
setTemplateParam
Set a request URI template map parameter to the request, expanded when the request URI is aUriTemplate.- Parameters:
paramName- the param nameparamValue- the param value- Returns:
- a reference to this, so the API can be used fluently
-
followRedirects
Set whether to follow request redirections- 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
-
routingKey
Set the routing key, the routing key can be used by a Vert.x client side sticky load balancer to pin the request to a remote HTTP server.- Parameters:
key- the routing key- Returns:
- a reference to this, so the API can be used fluently
-
routingKey
Return the routing key, the routing key can be used by a Vert.x client side sticky load balancer to pin the request to a remote HTTP server.- Returns:
- the routing key
-
proxy
Configure the request to set a proxy for this request. Setting proxy here supersedes the proxy set on the client itself- 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
-
queryParams
public io.vertx.core.MultiMap queryParams()Return the current query parameters.- Returns:
- the current query parameters
-
templateParams
Return the current request URI template parameters.- Returns:
- the current request URI template parameters
-
copy
Copy this request- Returns:
- a copy of this request
-
multipartMixed
Allow or disallow multipart mixed encoding when sendingMultipartFormhaving files sharing the same file name.
The default value istrue.
Set tofalseif you want to achieve the behavior for HTML5.- Parameters:
allow-trueallows 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
Trace operation name override.- Parameters:
traceOperation- Name of operation to use in traces- Returns:
- a reference to this, so the API can be used fluently
-
traceOperation
- Returns:
- the trace operation name override
-
newInstance
Creates a new instance of theHttpRequest. -
newInstance
public static <T> HttpRequest<T> newInstance(io.vertx.ext.web.client.HttpRequest<T> delegate, TypeArg<T> typeArg_0) Creates a new instance of theHttpRequest. -
hashCode
public int hashCode() -
equals
-
toString
-