public interface ProxyRequest
Modifier and Type | Method and Description |
---|---|
String |
absoluteURI() |
String |
getAuthority() |
Body |
getBody() |
HttpMethod |
getMethod() |
String |
getURI() |
MultiMap |
headers() |
HttpServerRequest |
proxiedRequest() |
default Future<Void> |
proxy(HttpClientRequest request)
Proxy this request to the origin server using the specified
request and then send the proxy response. |
ProxyRequest |
putHeader(CharSequence name,
CharSequence value)
Put an HTTP header
|
ProxyRequest |
release()
Release the proxy request and its associated resources
|
ProxyResponse |
response()
Create and return the proxy response.
|
static ProxyRequest |
reverseProxy(HttpServerRequest proxiedRequest)
Create a new
ProxyRequest instance, the proxied request will be paused. |
Future<ProxyResponse> |
send(HttpClientRequest request)
Send this request to the origin server using the specified
request . |
ProxyRequest |
setAuthority(String authority)
Set the request authority
for HTTP/1 the Host header
for HTTP/2 the :authority pseudo header
The value must follow the <host>:<port> syntax.
|
ProxyRequest |
setBody(Body body)
Set the request body to be sent to the origin server.
|
ProxyRequest |
setMethod(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.
|
HttpVersion |
version() |
static ProxyRequest reverseProxy(HttpServerRequest proxiedRequest)
ProxyRequest
instance, the proxied request will be paused.proxiedRequest
- the HttpServerRequest
that is proxiedHttpVersion version()
String absoluteURI()
HttpMethod getMethod()
ProxyRequest setMethod(HttpMethod method)
The initial HTTP method value is the proxied request HTTP method.
method
- the new HTTP methodString getURI()
ProxyRequest setURI(String uri)
The initial request URI value is the proxied request URI.
uri
- the new URIBody getBody()
ProxyRequest setBody(Body body)
The initial request body value is the proxied request body.
body
- the new bodyProxyRequest setAuthority(String authority)
authority
- the authorityString getAuthority()
MultiMap headers()
ProxyRequest putHeader(CharSequence name, CharSequence value)
name
- The header namevalue
- The header valuedefault Future<Void> proxy(HttpClientRequest request)
request
and then send the proxy response.request
- the request connected to the origin serverFuture<ProxyResponse> send(HttpClientRequest request)
request
.
The returned future will be completed with the proxy response returned by the origin.
request
- the request connected to the origin serverProxyRequest release()
The HTTP server request is resumed, no HTTP server response is sent.
HttpServerRequest proxiedRequest()
ProxyResponse response()
Copyright © 2023 Eclipse. All rights reserved.