- All Known Subinterfaces:
RoutingRequest
,ServerRequest
public interface HttpRequest
HTTP Request.
Used for all HTTP versions.
-
Method Summary
Modifier and TypeMethodDescriptionThe content of theHeaderNames.HOST
header orauthority
pseudo header (HTTP/2).void
Replace (or set) a request header.headers()
Headers of the request.int
id()
Request ID on this connection.Peer info of the local side.path()
Path of the request, with methods to get path parameters.prologue()
Prologue of the request.query()
Query of the request.Peer info of the remote peer.URI as requested by the originating client (to the best of our ability to compute it).
-
Method Details
-
prologue
HttpPrologue prologue()Prologue of the request.- Returns:
- HTTP prologue
-
headers
ServerRequestHeaders headers()Headers of the request.- Returns:
- HTTP headers
-
path
UriPath path()Path of the request, with methods to get path parameters.- Returns:
- HTTP path
-
query
UriQuery query()Query of the request.- Returns:
- HTTP query
-
remotePeer
PeerInfo remotePeer()Peer info of the remote peer.- Returns:
- remote peer info
-
localPeer
PeerInfo localPeer()Peer info of the local side.- Returns:
- local peer info
-
authority
String authority()The content of theHeaderNames.HOST
header orauthority
pseudo header (HTTP/2).- Returns:
- authority of this request
-
header
Replace (or set) a request header. This may be useful in filters, or on re-routing.- Parameters:
header
- header to set
-
id
int id()Request ID on this connection. In HTTP/1, this is a number between 0 andInteger.MAX_VALUE
. When the number of requests reaches maximum, it starts again from 0. In HTTP/2, this is the stream id.- Returns:
- id of this request on a connection
-
requestedUri
UriInfo requestedUri()URI as requested by the originating client (to the best of our ability to compute it). By default, the URI is from theHeaderNames.HOST
header on the current request. If requested URI discovery is enabled by configuration, additional headers (such asHeaderNames.FORWARDED
) may be used to derive the originally-requested URI.- Returns:
- uri info that can be used for redirects
-