Module jpro.webapi

Class Request

java.lang.Object
com.jpro.webapi.server.Request

@Experimental public abstract class Request extends Object
Represents a request with properties such as path, URI, host, and method. This is an abstract class that provides a blueprint for request implementations.
  • Constructor Details

    • Request

      public Request()
  • Method Details

    • getPath

      public abstract String getPath()
      Returns the path of the request. The path typically represents the endpoint or resource requested.
      Returns:
      the path of the request
    • getURI

      public abstract String getURI()
      Returns the URI of the request. The URI typically includes the scheme, host, and path.
      Returns:
      the URI of the request
    • getHost

      public abstract String getHost()
      Returns the host of the request. The host typically represents the domain or IP address of the server.
      Returns:
      the host of the request
    • getMethod

      public abstract String getMethod()
      Returns the method of the request. The method typically represents the HTTP method used (e.g., GET, POST, etc.).
      Returns:
      the method of the request
    • getHeaders

      public abstract Map<String,List<String>> getHeaders()
      Returns the headers of the request.
      Returns:
      an unmodifiable map from header name to list of values
    • getBody

      public abstract byte[] getBody()
      Returns the body of the request.
      Returns:
      the body of the request as a byte array
    • toString

      public String toString()
      Overrides:
      toString in class Object