Interface BaseRequest

All Known Subinterfaces:
InterceptableRequest, Request, Request, WebRequest

public interface BaseRequest

Base HTTP request for representing client or server requests.

It exposes content information following HTTP request message format as defined by RFC7230 and RFC7231.

Considering a client exchange, where the request is created and sent from the client to the server, implementation shall provide methods to set HTTP request content. Considering a server exchange, where the request is received by the server from the client, implementation shall provide methods to access HTTP request content.

Since:
1.6
Author:
Jeremy Kuhn
  • Method Details

    • getScheme

      String getScheme()

      Returns the name of the scheme used to send the request (eg. http, https...).

      Returns:
      the name of the scheme
    • getLocalAddress

      SocketAddress getLocalAddress()

      Returns the socket address of the interface on which the request was sent or received.

      Returns:
      a socket address
    • getLocalCertificates

      Optional<Certificate[]> getLocalCertificates()

      Returns the certificates that were sent to the remote peer during handshaking.

      Returns:
      an optional returning the list of local certificates or an empty optional if no certificates were sent.
    • getRemoteAddress

      SocketAddress getRemoteAddress()

      Returns the socket address of the client or last proxy that sent or received the request.

      Returns:
      a socket address
    • getRemoteCertificates

      Optional<Certificate[]> getRemoteCertificates()

      Returns the certificates that were received from the remote peer during handshaking.

      Returns:
      an optional returning the list of remote certificates or an empty optional if no certificates were received.
    • getMethod

      Method getMethod()

      Returns the HTTP method of the request.

      Returns:
      the HTTP method
    • getAuthority

      String getAuthority()

      Returns the request authority.

      Returns:
      the authority
    • getPath

      String getPath()

      Returns the path to the resource targeted in the request.

      This path corresponds to the origin form as defined by RFC 7230 Section 5.3.1, as such it may contain a query URI component.

      Returns:
      the path to the targeted resource
    • getPathAbsolute

      String getPathAbsolute()

      Returns the absolute path to the resource targeted in the request.

      This path corresponds to the absolute path of the origin form as defined by RFC 7230 Section 5.3.1, as such it only contains the path URI component.

      The resulting path is also normalized as defined by RFC 3986 Section 6.

      Returns:
      the normalized absolute path to the targeted resource
    • getPathBuilder

      URIBuilder getPathBuilder()

      Returns a path builder initialized with the path of the request.

      This method always returns a new URIBuilder instance with URIs.Option.NORMALIZED option. It is then safe to use it to build relative paths.

      Returns:
      a new URI builder
    • getQuery

      String getQuery()

      Returns the query URI component.

      Returns:
      a URI query component
    • queryParameters

      QueryParameters queryParameters()

      Returns the query parameters of the request.

      Returns:
      the request query parameters
    • headers

      Returns the HTTP headers of the request.

      Returns:
      the request headers