Interface EndpointRequest


public interface EndpointRequest
HTTP request data definition
Author:
ludomikula
  • Method Details

    • uri

      URI uri()
      Returns:
      Requested URI
    • method

      Returns:
      HTTP request method
    • body

      CompletableFuture<byte[]> body()
      Returns:
      Request body
    • headers

      Map<String,List<String>> headers()
      Returns:
      Request headers
    • header

      default List<String> header(String header)
      Parameters:
      header - Request header to retrieve
      Returns:
      Requested header values or null if not found
    • cookies

      Returns:
      Cookies as found in request
    • cookie

      default List<Map.Entry<String,String>> cookie(String cookie)
      Parameters:
      cookie - Request cookie to retrieve
      Returns:
      Requested cookie values or null if not found
    • attributes

      Map<String,Object> attributes()
      Returns:
      Request attributes
    • attribute

      default Optional<Object> attribute(String name)
      Parameters:
      name - Request attribute to retrieve
      Returns:
      Requested attribute value
    • pathVariables

      Map<String,String> pathVariables()
      Returns:
      Request path variables
    • pathVariable

      default String pathVariable(String name)
      Get the path variable with the given name, if present.
      Parameters:
      name - the variable name
      Returns:
      the variable value
      Throws:
      IllegalArgumentException - if there is no path variable with the given name
    • queryParams

      Map<String,List<String>> queryParams()
      Returns:
      Request query parameters
    • queryParam

      default List<String> queryParam(String name)
      Get the path variable with the given name, if present.
      Parameters:
      name - the variable name
      Returns:
      the variable value
      Throws:
      IllegalArgumentException - if there is no path variable with the given name
    • principal

      CompletableFuture<? extends Principal> principal()
      Returns:
      Security principal