Interface HttpRequest

All Known Subinterfaces:
JsonRpcRequest, 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()
      Authority exposed for this request. An HTTP/1 absolute-form request-target supplies the normalized HeaderNames.HOST value; other HTTP/1 request forms expose that header as received. HTTP/2 uses the :authority pseudo-header when present and otherwise uses Host; a conflict is rejected.
      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, Helidon reconstructs the URI using the effective request authority, request path, and connection scheme. For an HTTP/1 absolute-form request-target, its scheme and authority take precedence over the Host header. If requested URI discovery is enabled by configuration, headers from trusted proxies (such as HeaderNames.FORWARDED) may override the corresponding URI components.
      Returns:
      uri info that can be used for redirects