Interface HttpRequest

All Known Subinterfaces:
RoutingRequest, ServerRequest

public interface HttpRequest
HTTP Request. Used for all HTTP versions.
  • Method Details

    • prologue

      HttpPrologue prologue()
      Prologue of the request.
      Returns:
      HTTP prologue
    • 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 the HeaderNames.HOST header or authority pseudo header (HTTP/2).
      Returns:
      authority of this request
    • header

      void header(Header 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 and Integer.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 the HeaderNames.HOST header on the current request. If requested URI discovery is enabled by configuration, additional headers (such as HeaderNames.FORWARDED) may be used to derive the originally-requested URI.
      Returns:
      uri info that can be used for redirects