Interface HttpRequest

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getHeader​(java.lang.String name)
      Gets the header's value.
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHeaders()
      Gets an immutable map containing the request headers and their values.
      java.lang.String getMethod()
      Gets the HTTP request method.
      java.net.URL getUrl()
      Gets the HTTP request URL.
      void setHeader​(java.lang.String name, java.lang.String value)
      Sets an HTTP header or overwrites an existing HTTP header with new value.
    • Method Detail

      • getUrl

        java.net.URL getUrl()
        Gets the HTTP request URL.
      • getMethod

        java.lang.String getMethod()
        Gets the HTTP request method.
      • getHeaders

        java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHeaders()
        Gets an immutable map containing the request headers and their values.
      • getHeader

        java.lang.String getHeader​(java.lang.String name)
        Gets the header's value.
        Parameters:
        name - Header name for which to retrieve the value.
        Returns:
        The header's value, which might also be null if not set.
      • setHeader

        void setHeader​(java.lang.String name,
                       java.lang.String value)
        Sets an HTTP header or overwrites an existing HTTP header with new value.

        Trying to set an HTTP header with null name will return immediately. Trying to set one of the following restricted headers will also return immediately.

        • Access-Control-Request-Headers
        • Access-Control-Request-Method
        • Connection
        • Content-Length
        • Content-Transfer-Encoding
        • Host
        • Keep-Alive
        • Origin
        • Trailer
        • Transfer-Encoding
        • Upgrade
        • Via
        Parameters:
        name - The header's name, which must not be null or any of the restricted headers.
        value - The header's value