public interface ProxyRequest
Modifier and Type | Method and Description |
---|---|
String |
absoluteURI() |
ProxyRequest |
bodyFilter(Function<io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>,io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>> filter)
Set a body filter.
|
Body |
getBody() |
io.vertx.core.http.HttpMethod |
getMethod() |
String |
getURI() |
io.vertx.core.MultiMap |
headers() |
io.vertx.core.http.HttpServerRequest |
outboundRequest() |
default io.vertx.core.Future<Void> |
proxy(io.vertx.core.http.HttpClientRequest inboundRequest)
Proxy this outbound request and response to the origin server using the specified inbound request.
|
ProxyRequest |
putHeader(CharSequence name,
CharSequence value)
Put an HTTP header
|
ProxyRequest |
release()
Release the proxy request.
|
ProxyResponse |
response()
Create and return the proxy response.
|
static ProxyRequest |
reverseProxy(io.vertx.core.http.HttpServerRequest outboundRequest)
Create a new
ProxyRequest instance, the outbound request will be paused. |
io.vertx.core.Future<ProxyResponse> |
send(io.vertx.core.http.HttpClientRequest inboundRequest)
Send this request to the origin server using the specified inbound request.
|
ProxyRequest |
setBody(Body body)
Set the request body to be sent to the origin server.
|
ProxyRequest |
setMethod(io.vertx.core.http.HttpMethod method)
Set the HTTP method to be sent to the origin server.
|
ProxyRequest |
setURI(String uri)
Set the request URI to be sent to the origin server.
|
io.vertx.core.http.HttpVersion |
version() |
static ProxyRequest reverseProxy(io.vertx.core.http.HttpServerRequest outboundRequest)
ProxyRequest
instance, the outbound request will be paused.outboundRequest
- the HttpServerRequest
of the user agentio.vertx.core.http.HttpVersion version()
String absoluteURI()
io.vertx.core.http.HttpMethod getMethod()
ProxyRequest setMethod(io.vertx.core.http.HttpMethod method)
The initial HTTP method value is the outbound request HTTP method.
method
- the new HTTP methodString getURI()
ProxyRequest setURI(String uri)
The initial request URI value is the outbound request URI.
uri
- the new URIBody getBody()
ProxyRequest setBody(Body body)
The initial request body value is the outbound request body.
body
- the new bodyio.vertx.core.MultiMap headers()
ProxyRequest putHeader(CharSequence name, CharSequence value)
name
- The header namevalue
- The header valueProxyRequest bodyFilter(Function<io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>,io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>> filter)
The body filter can rewrite the request body sent to the origin server.
filter
- the filterdefault io.vertx.core.Future<Void> proxy(io.vertx.core.http.HttpClientRequest inboundRequest)
inboundRequest
- the request connected to the origin serverio.vertx.core.Future<ProxyResponse> send(io.vertx.core.http.HttpClientRequest inboundRequest)
The completionHandler
will be called with the proxy response sent by the origin.
inboundRequest
- the request connected to the origin serverProxyRequest release()
The HTTP server request is resumed, no HTTP server response is sent.
io.vertx.core.http.HttpServerRequest outboundRequest()
ProxyResponse response()
Copyright © 2021 Eclipse. All rights reserved.