Class Request

    • Constructor Detail

      • Request

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

        public Request​(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​(String uri,
                       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​(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​(String uri,
                       byte[] body,
                       Request.Method method,
                       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​(String uri,
                       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 String getUri()
        Returns the URI of this Request.
        Returns:
        the URI of this Request
      • getAttributes

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