public interface ServerRequest
| Modifier and Type | Interface | Description |
|---|---|---|
static interface |
ServerRequest.Content |
Represents an HTTP request content as a
publisher of RequestChunks with specific
features. |
static interface |
ServerRequest.Path |
Represents requested normalised URI path processed by
PathMatcher. |
static interface |
ServerRequest.Reader<R> |
The Reader transforms a byte buffer publisher into a completion stage of the associated type.
|
| Modifier and Type | Method | Description |
|---|---|---|
ServerRequest.Content |
content() |
Returns
reactive representation of the request content. |
ContextualRegistry |
context() |
Returns a request context as a child of
WebServer context. |
java.lang.String |
fragment() |
Returns a decoded request URI fragment without leading hash '#' character.
|
RequestHeaders |
headers() |
Returns http request headers.
|
boolean |
isSecure() |
Returns an indicating whether this request was made using a secure channel, such as HTTPS.
|
java.lang.String |
localAddress() |
Returns the Internet Protocol (IP) address of the interface on which the request was received.
|
int |
localPort() |
Returns the Internet Protocol (IP) port number of the interface on which the request was received.
|
Http.RequestMethod |
method() |
Returns an HTTP request method.
|
void |
next() |
Continue request processing on the next registered handler.
|
void |
next(java.lang.Throwable t) |
Continues or enters an error branch of a request processing.
|
ServerRequest.Path |
path() |
Returns a path which was accepted by
PathMatcher in actual routing. |
java.lang.String |
query() |
Returns an encoded query string without leading '?' character.
|
Parameters |
queryParams() |
Returns query parameters.
|
java.lang.String |
remoteAddress() |
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.
|
int |
remotePort() |
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.
|
long |
requestId() |
A unique correlation ID that is associated with this request and its associated response.
|
io.opentracing.Span |
span() |
Deprecated.
use
spanContext() instead |
io.opentracing.SpanContext |
spanContext() |
Returns a span context related to the current request.
|
java.net.URI |
uri() |
Returns a Request-URI (or alternatively path) as defined in request line.
|
Http.Version |
version() |
Returns an HTTP version from the request line.
|
WebServer |
webServer() |
Returns actual
WebServer instance. |
void next()
If error is being handled, this is identical to calling next(Throwable)
with a cause of the error.
void next(java.lang.Throwable t)
t except that
the exception is directly passed to a next registered ErrorHandler
and this it's faster.
It is not possible to leave error request processing and continue in registered Handler.
t - a cause that is directly passed to a next registered ErrorHandlerWebServer webServer()
WebServer instance.WebServer instanceContextualRegistry context()
WebServer context.Http.RequestMethod method()
HTTP standard methods utility class.Http.MethodHttp.Version version()
See HTTP Version enumeration for supported versions.
If communication starts as a HTTP/1.1 with h2c upgrade, then it will be automatically
upgraded and this method returns HTTP/2.0.
java.net.URI uri()
java.lang.String query()
Parameters queryParams()
ServerRequest.Path path()
PathMatcher in actual routing. It is path without a context root
of the routing.
Use ServerRequest.Path.absolute() method to obtain absolute request URI path representation.
Returned ServerRequest.Path also provide access to path template parameters. An absolute path then provides access to
all (including) context parameters if any. In case of conflict between parameter names, most recent value is returned.
java.lang.String fragment()
java.lang.String localAddress()
int localPort()
java.lang.String remoteAddress()
int remotePort()
boolean isSecure()
true if the request was made using a secure channelRequestHeaders headers()
ServerRequest.Content content()
reactive representation of the request content.ServerRequest.Contentlong requestId()
@Deprecated io.opentracing.Span span()
spanContext() insteadHandler call.
Span is a tracing component from opentracing.io standard.
io.opentracing.SpanContext spanContext()
SpanContext is a tracing component from opentracing.io standard.
Copyright © 2018 Oracle Corporation. All rights reserved.