Class Request

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Request.Method  
    • Constructor Summary

      Constructors 
      Constructor Description
      Request​(java.lang.String uri)
      Creates a Request with an empty body.
      Request​(java.lang.String uri, byte[] body)
      Creates a GET Request with a message body.
      Request​(java.lang.String uri, byte[] body, Request.Method method)
      Creates a Request with a message body.
      Request​(java.lang.String uri, byte[] body, Request.Method method, java.security.Principal principal)
      Creates a Request with a message body, method and user principal.
      Request​(java.lang.String uri, java.lang.String body)
      Creates a GET Request with a message body.
      Request​(java.lang.String uri, java.lang.String body, Request.Method method)
      Creates a Request with a message body.
    • Constructor Detail

      • Request

        public Request​(java.lang.String uri)
        Creates a Request with an empty body.
        Parameters:
        uri - the URI of the request
      • Request

        public Request​(java.lang.String uri,
                       byte[] body)
        Creates a GET Request with a message body.
        Parameters:
        uri - the URI of the request
        body - the body of the request
      • Request

        public Request​(java.lang.String uri,
                       java.lang.String body)
        Creates a GET Request with a message body.
        Parameters:
        uri - the URI of the request
        body - the body of the request as a UTF-8 string
      • Request

        public Request​(java.lang.String uri,
                       byte[] body,
                       Request.Method method)
        Creates a Request with a message body.
        Parameters:
        uri - the URI of the request
        body - the body of the request
      • Request

        public Request​(java.lang.String uri,
                       byte[] body,
                       Request.Method method,
                       java.security.Principal principal)
        Creates a Request with a message body, method and user principal.
        Parameters:
        uri - the URI of the request
        body - the body of the request
        method - the method of the request
        principal - the user principal of the request
      • Request

        public Request​(java.lang.String uri,
                       java.lang.String body,
                       Request.Method method)
        Creates a Request with a message body.
        Parameters:
        uri - the URI of the request
        body - the body of the request as a UTF-8 string
    • Method Detail

      • getHeaders

        public Headers getHeaders()
        Returns a mutable multi-map of headers for this Request.
        Returns:
        a mutable multi-map of headers for this Request
      • getBody

        public byte[] getBody()
        Returns the body of this Request.
        Returns:
        the body of this Request
      • getUri

        public java.lang.String getUri()
        Returns the URI of this Request.
        Returns:
        the URI of this Request
      • getAttributes

        public java.util.Map<java.lang.String,​java.lang.Object> getAttributes()
        Returns:
        a mutable attribute map for this request.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getUserPrincipal

        public java.util.Optional<java.security.Principal> getUserPrincipal()