Class HttpPrologue

java.lang.Object
io.helidon.http.HttpPrologue

@Describe(PerRequest.class) public class HttpPrologue extends Object
A prologue of an HTTP protocol.
  • Method Details

    • create

      public static HttpPrologue create(String rawProtocol, String protocol, String protocolVersion, Method httpMethod, String unresolvedPath, boolean validatePath)
      Create a new prologue.
      Parameters:
      rawProtocol - raw protocol string (full HTTP/1.1 or similar)
      protocol - protocol
      protocolVersion - protocol version
      httpMethod - HTTP Method
      unresolvedPath - unresolved path
      validatePath - whether to validate path (that it contains only allowed characters)
      Returns:
      a new prologue
    • create

      public static HttpPrologue create(String rawProtocol, String protocol, String protocolVersion, Method httpMethod, UriPath uriPath, UriQuery uriQuery, UriFragment uriFragment)
      Create a new prologue with decoded values.
      Parameters:
      rawProtocol - raw protocol string (full HTTP/1.1 or similar)
      protocol - protocol
      protocolVersion - protocol version
      httpMethod - HTTP Method
      uriPath - resolved path
      uriQuery - resolved query
      uriFragment - resolved fragment
      Returns:
      a new prologue
    • rawProtocol

      public String rawProtocol()
      Raw protocol, should be HTTP/1.1 or HTTP/2 in most cases.
      Returns:
      protocol
    • protocol

      public String protocol()
      Protocol name, should be HTTP in most cases.
      Returns:
      protocol
    • protocolVersion

      public String protocolVersion()
      HTTP protocol version of this request.
      Returns:
      protocol
    • method

      public Method method()
      HTTP method of this request.
      Returns:
      method
    • uriPath

      public UriPath uriPath()
      Path or the request.
      Returns:
      path
    • withUriPath

      public HttpPrologue withUriPath(UriPath uriPath)
      Create a prologue with a different path, preserving the query delimiter and fragment.
      Parameters:
      uriPath - resolved path
      Returns:
      prologue with the provided path
    • withProtocol

      public HttpPrologue withProtocol(String rawProtocol, String protocol, String protocolVersion)
      Create a prologue with different protocol values, preserving the path, query delimiter, method, and fragment.
      Parameters:
      rawProtocol - raw protocol string
      protocol - protocol
      protocolVersion - protocol version
      Returns:
      prologue with the provided protocol values
    • query

      public UriQuery query()
      Query of the request.
      Returns:
      query
    • hasQuery

      public boolean hasQuery()
      Whether the request target contains a query delimiter.

      This returns true even when the raw query is empty, for example for a request target ending in ?.

      Returns:
      whether the request target contains a query delimiter
    • fragment

      public UriFragment fragment()
      Fragment of the request.
      Returns:
      fragment
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object