Package io.vertx.rxjava3.httpproxy
Class ProxyRequest
- java.lang.Object
-
- io.vertx.rxjava3.httpproxy.ProxyRequest
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<ProxyRequest>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description ProxyRequest(ProxyRequest delegate)ProxyRequest(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringabsoluteURI()booleanequals(Object o)HostAndPortgetAuthority()BodygetBody()ProxyRequestgetDelegate()HttpMethodgetMethod()StringgetURI()inthashCode()MultiMapheaders()static ProxyRequestnewInstance(ProxyRequest arg)HttpServerRequestproxiedRequest()io.reactivex.rxjava3.core.Completableproxy(HttpClientRequest request)Proxy this request to the origin server using the specifiedrequestand then send the proxy response.ProxyRequestrelease()Release the proxy request and its associated resourcesProxyResponseresponse()Create and return the proxy response.static ProxyRequestreverseProxy(HttpServerRequest proxiedRequest)Create a newProxyRequestinstance, the proxied request will be paused.io.reactivex.rxjava3.core.CompletablerxProxy(HttpClientRequest request)Proxy this request to the origin server using the specifiedrequestand then send the proxy response.io.reactivex.rxjava3.core.Single<ProxyResponse>rxSend(HttpClientRequest request)Send this request to the origin server using the specifiedrequest.io.reactivex.rxjava3.core.Single<ProxyResponse>send(HttpClientRequest request)Send this request to the origin server using the specifiedrequest.ProxyRequestsetAuthority(HostAndPort authority)Set the request authority for HTTP/1 the header for HTTP/2 the pseudo header The value must follow the syntax.ProxyRequestsetBody(Body body)Set the request body to be sent to the origin server.ProxyRequestsetMethod(HttpMethod method)Set the HTTP method to be sent to the origin server.ProxyRequestsetURI(String uri)Set the request URI to be sent to the origin server.StringtoString()HttpVersionversion()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<ProxyRequest> __TYPE_ARG
-
-
Constructor Detail
-
ProxyRequest
public ProxyRequest(ProxyRequest delegate)
-
ProxyRequest
public ProxyRequest(Object delegate)
-
-
Method Detail
-
getDelegate
public ProxyRequest getDelegate()
-
reverseProxy
public static ProxyRequest reverseProxy(HttpServerRequest proxiedRequest)
Create a newProxyRequestinstance, the proxied request will be paused.- Parameters:
proxiedRequest- theHttpServerRequestthat is proxied- Returns:
- a reference to this, so the API can be used fluently
-
version
public HttpVersion version()
- Returns:
- the HTTP version of the proxied request
-
absoluteURI
public String absoluteURI()
- Returns:
- the absolute URI of the proxied request
-
getMethod
public HttpMethod getMethod()
- Returns:
- the HTTP method to be sent to the origin server.
-
setMethod
public ProxyRequest setMethod(HttpMethod method)
Set the HTTP method to be sent to the origin server.The initial HTTP method value is the proxied request HTTP 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)
Set the request URI to be sent to the origin server.The initial request URI value is the proxied request 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)
Set the request body to be sent to the origin server.The initial request body value is the proxied request body.
- Parameters:
body- the new body- Returns:
- a reference to this, so the API can be used fluently
-
setAuthority
public ProxyRequest setAuthority(HostAndPort authority)
Set the request authority- for HTTP/1 the header
- for HTTP/2 the pseudo header
- 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
public io.reactivex.rxjava3.core.Completable proxy(HttpClientRequest request)
Proxy this request to the origin server using the specifiedrequestand then send the proxy response.- Parameters:
request- the request connected to the origin server- Returns:
-
rxProxy
public io.reactivex.rxjava3.core.Completable rxProxy(HttpClientRequest request)
Proxy this request to the origin server using the specifiedrequestand then send the proxy response.- Parameters:
request- the request connected to the origin server- Returns:
-
send
public io.reactivex.rxjava3.core.Single<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.
- Parameters:
request- the request connected to the origin server- Returns:
-
rxSend
public io.reactivex.rxjava3.core.Single<ProxyResponse> rxSend(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.
- Parameters:
request- the request connected to the origin server- Returns:
-
release
public ProxyRequest release()
Release the proxy request and its associated resourcesThe HTTP server request is resumed, no HTTP server response is sent.
- 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()
Create and return the proxy response.- Returns:
- the proxy response
-
newInstance
public static ProxyRequest newInstance(ProxyRequest arg)
-
-