public class HttpRequest<T> extends Object
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
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
sendStream(io.vertx.reactivex.core.streams.ReadStream<io.vertx.reactivex.core.buffer.Buffer>, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
sendJson(java.lang.Object, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
()}sendForm(io.vertx.reactivex.core.MultiMap, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
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
HttpResponse
instance when the HTTP response has been receivedMost 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 RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<HttpRequest> |
__TYPE_ARG |
io.vertx.lang.rx.TypeArg<T> |
__typeArg_0 |
Constructor and Description |
---|
HttpRequest(HttpRequest delegate) |
HttpRequest(Object delegate,
io.vertx.lang.rx.TypeArg<T> typeArg_0) |
Modifier and Type | Method and Description |
---|---|
HttpRequest<T> |
addQueryParam(String paramName,
String paramValue)
Add a query parameter to the request.
|
<U> HttpRequest<U> |
as(BodyCodec<U> responseCodec)
Configure the request to decode the response with the
responseCodec . |
HttpRequest<T> |
authentication(Credentials credentials)
Configure the request to perform HTTP Authentication.
|
HttpRequest<T> |
basicAuthentication(Buffer id,
Buffer password)
Configure the request to perform basic access authentication.
|
HttpRequest<T> |
basicAuthentication(String id,
String password)
Configure the request to perform basic access authentication.
|
HttpRequest<T> |
bearerTokenAuthentication(String bearerToken)
Configure the request to perform bearer token authentication.
|
BodyCodec<T> |
bodyCodec() |
long |
connectTimeout() |
HttpRequest<T> |
connectTimeout(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 a
TimeoutException . |
HttpRequest<T> |
copy()
Copy this request
|
boolean |
equals(Object o) |
HttpRequest<T> |
expect(java.util.function.Function<HttpResponse<Void>,ResponsePredicateResult> predicate)
Deprecated.
|
HttpRequest<T> |
expect(ResponsePredicate predicate)
Deprecated.
|
List<ResponsePredicate> |
expectations()
Deprecated.
|
boolean |
followRedirects() |
HttpRequest<T> |
followRedirects(boolean value)
Set whether to follow request redirections
|
HttpRequest |
getDelegate() |
int |
hashCode() |
MultiMap |
headers() |
String |
host() |
HttpRequest<T> |
host(String value)
Configure the request to use a new host
value . |
long |
idleTimeout() |
HttpRequest<T> |
idleTimeout(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 a
TimeoutException . |
HttpMethod |
method() |
HttpRequest<T> |
method(HttpMethod value)
Configure the request to use a new method
value . |
boolean |
multipartMixed() |
HttpRequest<T> |
multipartMixed(boolean allow)
Allow or disallow multipart mixed encoding when sending having files sharing the same
file name.
|
static <T> HttpRequest<T> |
newInstance(HttpRequest arg) |
static <T> HttpRequest<T> |
newInstance(HttpRequest arg,
io.vertx.lang.rx.TypeArg<T> __typeArg_T) |
int |
port() |
HttpRequest<T> |
port(int value)
Configure the request to use a new port
value . |
ProxyOptions |
proxy() |
HttpRequest<T> |
proxy(ProxyOptions proxyOptions)
Configure the request to set a proxy for this request.
|
HttpRequest<T> |
putHeader(String name,
Iterable<String> value)
Configure the request to set a new HTTP header with multiple values.
|
HttpRequest<T> |
putHeader(String name,
String value)
Configure the request to set a new HTTP header.
|
HttpRequest<T> |
putHeaders(MultiMap headers)
Configure the request to add multiple HTTP headers .
|
MultiMap |
queryParams()
Return the current query parameters.
|
Single<HttpResponse<T>> |
rxSend()
Send a request, the
handler will receive the response as an HttpResponse . |
Single<HttpResponse<T>> |
rxSendBuffer(Buffer body)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body buffer. |
Single<HttpResponse<T>> |
rxSendForm(MultiMap body)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body multimap encoded as form and the content type
set to application/x-www-form-urlencoded . |
Single<HttpResponse<T>> |
rxSendForm(MultiMap body,
String charset)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body multimap encoded as form and the content type
set to application/x-www-form-urlencoded . |
Single<HttpResponse<T>> |
rxSendJson(Object body)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body object encoded as json and the content type
set to application/json . |
Single<HttpResponse<T>> |
rxSendJsonObject(JsonObject body)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body object encoded as json and the content type
set to application/json . |
Single<HttpResponse<T>> |
rxSendMultipartForm(MultipartForm body)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body multimap encoded as form and the content type
set to multipart/form-data . |
Single<HttpResponse<T>> |
rxSendStream(Flowable<Buffer> body)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body stream. |
Single<HttpResponse<T>> |
rxSendStream(ReadStream<Buffer> body)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body stream. |
void |
send()
Send a request, the
handler will receive the response as an HttpResponse . |
void |
send(Handler<AsyncResult<HttpResponse<T>>> handler)
Send a request, the
handler will receive the response as an HttpResponse . |
void |
sendBuffer(Buffer body)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body buffer. |
void |
sendBuffer(Buffer body,
Handler<AsyncResult<HttpResponse<T>>> handler)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body buffer. |
void |
sendForm(MultiMap body)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body multimap encoded as form and the content type
set to application/x-www-form-urlencoded . |
void |
sendForm(MultiMap body,
Handler<AsyncResult<HttpResponse<T>>> handler)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body multimap encoded as form and the content type
set to application/x-www-form-urlencoded . |
void |
sendForm(MultiMap body,
String charset)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body multimap encoded as form and the content type
set to application/x-www-form-urlencoded . |
void |
sendForm(MultiMap body,
String charset,
Handler<AsyncResult<HttpResponse<T>>> handler)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body multimap encoded as form and the content type
set to application/x-www-form-urlencoded . |
void |
sendJson(Object body)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body object encoded as json and the content type
set to application/json . |
void |
sendJson(Object body,
Handler<AsyncResult<HttpResponse<T>>> handler)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body object encoded as json and the content type
set to application/json . |
void |
sendJsonObject(JsonObject body)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body object encoded as json and the content type
set to application/json . |
void |
sendJsonObject(JsonObject body,
Handler<AsyncResult<HttpResponse<T>>> handler)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body object encoded as json and the content type
set to application/json . |
void |
sendMultipartForm(MultipartForm body)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body multimap encoded as form and the content type
set to multipart/form-data . |
void |
sendMultipartForm(MultipartForm body,
Handler<AsyncResult<HttpResponse<T>>> handler)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body multimap encoded as form and the content type
set to multipart/form-data . |
void |
sendStream(Flowable<Buffer> body)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body stream. |
void |
sendStream(Flowable<Buffer> body,
Handler<AsyncResult<HttpResponse<T>>> handler)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body stream. |
void |
sendStream(ReadStream<Buffer> body)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body stream. |
void |
sendStream(ReadStream<Buffer> body,
Handler<AsyncResult<HttpResponse<T>>> handler)
Like
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>) but with an HTTP request body stream. |
HttpRequest<T> |
setQueryParam(String paramName,
String paramValue)
Set a query parameter to the request.
|
HttpRequest<T> |
setTemplateParam(String paramName,
List<String> paramValue)
Set a request URI template list parameter to the request, expanded when the request URI is a .
|
HttpRequest<T> |
setTemplateParam(String paramName,
Map<String,String> paramValue)
Set a request URI template map parameter to the request, expanded when the request URI is a .
|
HttpRequest<T> |
setTemplateParam(String paramName,
String paramValue)
Set a request URI template string parameter to the request, expanded when the request URI is a .
|
Boolean |
ssl() |
HttpRequest<T> |
ssl(Boolean value)
Configure the request whether to use SSL.
|
Variables |
templateParams()
Return the current request URI template parameters.
|
long |
timeout() |
HttpRequest<T> |
timeout(long value)
Sets both connect and idle timeouts for the request
connect timeout: if the request is not obtained from the client within the timeout period, the
Future
obtained from the client is failed with a TimeoutException .
idle timeout: if the request does not return any data within the timeout period, the request/response is closed and the
related futures are failed with a TimeoutException , e.g. |
String |
toString() |
String |
traceOperation() |
HttpRequest<T> |
traceOperation(String traceOperation)
Trace operation name override.
|
String |
uri() |
HttpRequest<T> |
uri(String value)
Configure the request to use a new request URI
value . |
String |
virtualHost() |
HttpRequest<T> |
virtualHost(String value)
Configure the request to use a virtual host
value . |
public static final io.vertx.lang.rx.TypeArg<HttpRequest> __TYPE_ARG
public final io.vertx.lang.rx.TypeArg<T> __typeArg_0
public HttpRequest(HttpRequest delegate)
public HttpRequest getDelegate()
public HttpRequest<T> method(HttpMethod value)
value
.value
- public HttpMethod method()
public HttpRequest<T> port(int value)
value
.
This overrides the port set by absolute URI requests
value
- public int port()
0
when none is set for absolute URI templatespublic <U> HttpRequest<U> as(BodyCodec<U> responseCodec)
responseCodec
.responseCodec
- the response codecpublic HttpRequest<T> host(String value)
value
.
This overrides the host set by absolute URI requests
value
- public String host()
null
when none is set for absolute URI templatespublic HttpRequest<T> virtualHost(String value)
value
.
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.value
- public String virtualHost()
null
public HttpRequest<T> uri(String value)
value
.
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
value
- public String uri()
null
when none is set for absolute URI templatespublic HttpRequest<T> putHeaders(MultiMap headers)
headers
- The HTTP headerspublic HttpRequest<T> putHeader(String name, String value)
name
- the header namevalue
- the header valuepublic MultiMap headers()
public HttpRequest<T> basicAuthentication(String id, String password)
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 a object.id
- the idpassword
- the passwordpublic HttpRequest<T> basicAuthentication(Buffer id, Buffer password)
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 a object.id
- the idpassword
- the passwordpublic HttpRequest<T> bearerTokenAuthentication(String bearerToken)
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 a object.bearerToken
- the bearer tokenpublic HttpRequest<T> ssl(Boolean value)
This overrides the SSL value set by absolute URI requests
value
- public Boolean ssl()
null
when none is set for absolute URI templatespublic HttpRequest<T> timeout(long value)
Future
obtained from the client is failed with a TimeoutException
.TimeoutException
, e.g. Future
or Future
response body.connectTimeout(long)
and idleTimeout(long)
value
- public long timeout()
public HttpRequest<T> idleTimeout(long timeout)
TimeoutException
.
The timeout starts after a connection is obtained from the client.timeout
- the amount of time in milliseconds.public long idleTimeout()
public HttpRequest<T> connectTimeout(long timeout)
TimeoutException
.
Note this is not related to the TCP 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.timeout
- the amount of time in milliseconds.public long connectTimeout()
public HttpRequest<T> addQueryParam(String paramName, String paramValue)
paramName
- the param nameparamValue
- the param valuepublic HttpRequest<T> setQueryParam(String paramName, String paramValue)
paramName
- the param nameparamValue
- the param valuepublic HttpRequest<T> setTemplateParam(String paramName, String paramValue)
paramName
- the param nameparamValue
- the param valuepublic HttpRequest<T> setTemplateParam(String paramName, List<String> paramValue)
paramName
- the param nameparamValue
- the param valuepublic HttpRequest<T> setTemplateParam(String paramName, Map<String,String> paramValue)
paramName
- the param nameparamValue
- the param valuepublic HttpRequest<T> followRedirects(boolean value)
value
- true if redirections should be followedpublic boolean followRedirects()
public HttpRequest<T> proxy(ProxyOptions proxyOptions)
proxyOptions
- The proxy optionspublic ProxyOptions proxy()
@Deprecated public HttpRequest<T> expect(java.util.function.Function<HttpResponse<Void>,ResponsePredicateResult> predicate)
predicate
.
Multiple predicates can be added.
predicate
- the predicate@Deprecated public HttpRequest<T> expect(ResponsePredicate predicate)
predicate
.
Multiple predicates can be added.
predicate
- the predicate@Deprecated public List<ResponsePredicate> expectations()
public MultiMap queryParams()
public Variables templateParams()
public HttpRequest<T> copy()
public HttpRequest<T> multipartMixed(boolean allow)
true
.
false
if you want to achieve the behavior for HTML5.allow
- true
allows use of multipart mixed encodingpublic boolean multipartMixed()
public HttpRequest<T> traceOperation(String traceOperation)
traceOperation
- Name of operation to use in tracespublic String traceOperation()
public void sendStream(ReadStream<Buffer> body, Handler<AsyncResult<HttpResponse<T>>> handler)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
stream.body
- the bodyhandler
- public void sendStream(ReadStream<Buffer> body)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
stream.body
- the bodypublic Single<HttpResponse<T>> rxSendStream(ReadStream<Buffer> body)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
stream.body
- the bodypublic void sendStream(Flowable<Buffer> body, Handler<AsyncResult<HttpResponse<T>>> handler)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
stream.body
- the bodyhandler
- public void sendStream(Flowable<Buffer> body)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
stream.body
- the bodypublic Single<HttpResponse<T>> rxSendStream(Flowable<Buffer> body)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
stream.body
- the bodypublic void sendBuffer(Buffer body, Handler<AsyncResult<HttpResponse<T>>> handler)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
buffer.body
- the bodyhandler
- public void sendBuffer(Buffer body)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
buffer.body
- the bodypublic Single<HttpResponse<T>> rxSendBuffer(Buffer body)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
buffer.body
- the bodypublic void sendJsonObject(JsonObject body, Handler<AsyncResult<HttpResponse<T>>> handler)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
object encoded as json and the content type
set to application/json
.body
- the bodyhandler
- public void sendJsonObject(JsonObject body)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
object encoded as json and the content type
set to application/json
.body
- the bodypublic Single<HttpResponse<T>> rxSendJsonObject(JsonObject body)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
object encoded as json and the content type
set to application/json
.body
- the bodypublic void sendJson(Object body, Handler<AsyncResult<HttpResponse<T>>> handler)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
object encoded as json and the content type
set to application/json
.body
- the bodyhandler
- public void sendJson(Object body)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
object encoded as json and the content type
set to application/json
.body
- the bodypublic Single<HttpResponse<T>> rxSendJson(Object body)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
object encoded as json and the content type
set to application/json
.body
- the bodypublic void sendForm(MultiMap body, Handler<AsyncResult<HttpResponse<T>>> handler)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
multimap encoded as form and the content type
set to application/x-www-form-urlencoded
.
When the content type header is previously set to multipart/form-data
it will be used instead.
body
- the bodyhandler
- public void sendForm(MultiMap body)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
multimap encoded as form and the content type
set to application/x-www-form-urlencoded
.
When the content type header is previously set to multipart/form-data
it will be used instead.
body
- the bodypublic Single<HttpResponse<T>> rxSendForm(MultiMap body)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
multimap encoded as form and the content type
set to application/x-www-form-urlencoded
.
When the content type header is previously set to multipart/form-data
it will be used instead.
body
- the bodypublic void sendForm(MultiMap body, String charset, Handler<AsyncResult<HttpResponse<T>>> handler)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
multimap encoded as form and the content type
set to application/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 a application/x-www-form-urlencoded
encoded form since the charset to use must be UTF-8.
body
- the bodycharset
- handler
- public void sendForm(MultiMap body, String charset)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
multimap encoded as form and the content type
set to application/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 a application/x-www-form-urlencoded
encoded form since the charset to use must be UTF-8.
body
- the bodycharset
- public Single<HttpResponse<T>> rxSendForm(MultiMap body, String charset)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
but with an HTTP request body
multimap encoded as form and the content type
set to application/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 a application/x-www-form-urlencoded
encoded form since the charset to use must be UTF-8.
body
- the bodycharset
- public void sendMultipartForm(MultipartForm body, Handler<AsyncResult<HttpResponse<T>>> handler)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
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.body
- the bodyhandler
- public void sendMultipartForm(MultipartForm body)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
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.body
- the bodypublic Single<HttpResponse<T>> rxSendMultipartForm(MultipartForm body)
send(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.ext.web.client.HttpResponse<T>>>)
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.body
- the bodypublic void send(Handler<AsyncResult<HttpResponse<T>>> handler)
handler
will receive the response as an HttpResponse
.handler
- public void send()
handler
will receive the response as an HttpResponse
.public Single<HttpResponse<T>> rxSend()
handler
will receive the response as an HttpResponse
.public HttpRequest<T> putHeader(String name, Iterable<String> value)
name
- the header namevalue
- the header valuepublic HttpRequest<T> authentication(Credentials credentials)
Performs a generic authentication using the credentials provided by the user. For the sake of validation safety it is recommended that is called to ensure that the credentials are applicable to the HTTP Challenged received on a previous request that returned a 401 response code.
credentials
- the credentials to use.public static <T> HttpRequest<T> newInstance(HttpRequest arg)
public static <T> HttpRequest<T> newInstance(HttpRequest arg, io.vertx.lang.rx.TypeArg<T> __typeArg_T)
Copyright © 2024 Eclipse. All rights reserved.