public interface RoutingContext
| Modifier and Type | Method and Description |
|---|---|
List<MediaType> |
acceptTypes()
Returns a list of
MediaTypes that are specified in HttpHeaderNames.ACCEPT in the order
of client-side preferences. |
MediaType |
contentType()
Returns
MediaType specified by 'Content-Type' header of the request. |
HttpStatusException |
deferredStatusException()
Returns a deferred
HttpStatusException which was previously set via
deferStatusException(HttpStatusException). |
void |
deferStatusException(HttpStatusException cause)
Defers throwing an
HttpStatusException until reaching the end of the service list. |
RequestHeaders |
headers()
Returns the
RequestHeaders retrieved from the request. |
String |
hostname()
Returns the virtual host name of the request.
|
boolean |
isCorsPreflight()
Returns
true if this context is for a CORS preflight request. |
HttpMethod |
method()
Returns
HttpMethod of the request. |
default RoutingContext |
overridePath(String path)
Returns a wrapped
RoutingContext which holds the specified path. |
QueryParams |
params()
Returns the query parameters retrieved from the request path.
|
String |
path()
Returns the absolute path retrieved from the request,
as defined in RFC3986.
|
String |
query()
Returns the query retrieved from the request,
as defined in RFC3986.
|
default boolean |
requiresMatchingHeadersPredicates()
Returns
true if this context requires matching the predicates for HTTP headers. |
default boolean |
requiresMatchingParamsPredicates()
Returns
true if this context requires matching the predicates for query parameters. |
VirtualHost |
virtualHost()
Returns the
VirtualHost instance which belongs to this RoutingContext. |
VirtualHost virtualHost()
VirtualHost instance which belongs to this RoutingContext.String hostname()
HttpMethod method()
HttpMethod of the request.QueryParams params()
MediaType contentType()
MediaType specified by 'Content-Type' header of the request.List<MediaType> acceptTypes()
MediaTypes that are specified in HttpHeaderNames.ACCEPT in the order
of client-side preferences. If the client does not send the header, this will contain only
MediaType.ANY_TYPE.RequestHeaders headers()
RequestHeaders retrieved from the request.void deferStatusException(HttpStatusException cause)
HttpStatusException until reaching the end of the service list.HttpStatusException deferredStatusException()
HttpStatusException which was previously set via
deferStatusException(HttpStatusException).default RoutingContext overridePath(String path)
RoutingContext which holds the specified path.
It is usually used to find an HttpService with a prefix-stripped path.boolean isCorsPreflight()
true if this context is for a CORS preflight request.default boolean requiresMatchingParamsPredicates()
true if this context requires matching the predicates for query parameters.RouteBuilder.matchesParams(Iterable)default boolean requiresMatchingHeadersPredicates()
true if this context requires matching the predicates for HTTP headers.RouteBuilder.matchesHeaders(Iterable)Copyright © 2020 LeanCloud. All rights reserved.