Class ProxyRequest
- java.lang.Object
-
- io.vertx.mutiny.httpproxy.ProxyRequest
-
public class ProxyRequest extends Object
Handles the interoperability of the request between the user agent and the origin. 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<ProxyRequest>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description ProxyRequest(io.vertx.httpproxy.ProxyRequest delegate)
ProxyRequest(Object delegate)
-
Method Summary
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<ProxyRequest> __TYPE_ARG
-
-
Constructor Detail
-
ProxyRequest
public ProxyRequest(io.vertx.httpproxy.ProxyRequest delegate)
-
ProxyRequest
public ProxyRequest(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.httpproxy.ProxyRequest getDelegate()
-
reverseProxy
public static ProxyRequest reverseProxy(HttpServerRequest proxiedRequest)
- Parameters:
proxiedRequest
- theHttpServerRequest
that is proxied- Returns:
- a reference to this, so the API can be used fluently
-
version
public io.vertx.core.http.HttpVersion version()
- Returns:
- the HTTP version of the proxied request
-
absoluteURI
public String absoluteURI()
- Returns:
- the absolute URI of the proxied request
-
getMethod
public io.vertx.core.http.HttpMethod getMethod()
- Returns:
- the HTTP method to be sent to the origin server.
-
setMethod
public ProxyRequest setMethod(io.vertx.core.http.HttpMethod method)
- Parameters:
method
- the new HTTP method- Returns:
- a reference to this, so the API can be used fluently
-
getURI
public String getURI()
- Returns:
- the request URI to be sent to the origin server.
-
setURI
public ProxyRequest setURI(String uri)
- Parameters:
uri
- the new URI- Returns:
- a reference to this, so the API can be used fluently
-
getBody
public Body getBody()
- Returns:
- the request body to be sent to the origin server.
-
setBody
public ProxyRequest setBody(Body body)
- Parameters:
body
- the new body- Returns:
- a reference to this, so the API can be used fluently
-
setAuthority
public ProxyRequest setAuthority(HostAndPort authority)
- Parameters:
authority
- the authority- Returns:
- a reference to this, so the API can be used fluently
-
getAuthority
public HostAndPort getAuthority()
- Returns:
- the request authority, for HTTP2 the pseudo header otherwise the header
-
headers
public MultiMap headers()
- Returns:
- the headers that will be sent to the origin server, the returned headers can be modified. The headers map is populated with the proxied request headers
-
proxy
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> proxy(HttpClientRequest request)
Proxy this request to the origin server using the specifiedrequest
and then send the proxy response.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
request
- the request connected to the origin server- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
proxyAndAwait
public Void proxyAndAwait(HttpClientRequest request)
Blocking variant ofproxy(io.vertx.mutiny.core.http.HttpClientRequest)
.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:
request
- the request connected to the origin server- Returns:
- the Void instance produced by the operation.
-
proxyAndForget
public void proxyAndForget(HttpClientRequest request)
Variant ofproxy(io.vertx.mutiny.core.http.HttpClientRequest)
that ignores the result of the operation.This method subscribes on the result of
proxy(io.vertx.mutiny.core.http.HttpClientRequest)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromproxy(io.vertx.mutiny.core.http.HttpClientRequest)
but you don't need to compose it with other operations.- Parameters:
request
- the request connected to the origin server
-
send
@CheckReturnValue public io.smallrye.mutiny.Uni<ProxyResponse> send(HttpClientRequest request)
Send this request to the origin server using the specifiedrequest
.The returned future will be completed with the proxy response returned by the origin.
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
request
- the request connected to the origin server- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendAndAwait
public ProxyResponse sendAndAwait(HttpClientRequest request)
Blocking variant ofsend(io.vertx.mutiny.core.http.HttpClientRequest)
.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:
request
- the request connected to the origin server- Returns:
- the ProxyResponse instance produced by the operation.
-
sendAndForget
public void sendAndForget(HttpClientRequest request)
Variant ofsend(io.vertx.mutiny.core.http.HttpClientRequest)
that ignores the result of the operation.This method subscribes on the result of
send(io.vertx.mutiny.core.http.HttpClientRequest)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsend(io.vertx.mutiny.core.http.HttpClientRequest)
but you don't need to compose it with other operations.- Parameters:
request
- the request connected to the origin server
-
release
public ProxyRequest release()
- Returns:
- a reference to this, so the API can be used fluently
-
proxiedRequest
public HttpServerRequest proxiedRequest()
- Returns:
- the proxied HTTP server request
-
response
public ProxyResponse response()
- Returns:
- the proxy response
-
newInstance
public static ProxyRequest newInstance(io.vertx.httpproxy.ProxyRequest arg)
-
-