Interface HttpRequest


public interface HttpRequest
An object that contains information about the current HTTP-Request.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the specified request header as a String.
    Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
    Returns the query string that is contained in the request URL after the path.
    Returns the technology-specific request object.
    Returns the request URI including the optional query string.
    Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.
  • Method Details

    • getRequestURI

      String getRequestURI()
      Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.

      This is equivalent to javax.servlet.http.HttpServletRequest.getRequestURI().

      Returns:
      a String containing the part of the URL from the protocol name up to the query string
    • getQueryString

      String getQueryString()
      Returns the query string that is contained in the request URL after the path. This method returns null if the URL does not have a query string.

      This is equivalent to javax.servlet.http.HttpServletRequest.getQueryString().

      Returns:
      a String containing the query string or null if the URL contains no query string.
    • getRequestString

      String getRequestString()
      Returns the request URI including the optional query string.
      Returns:
      a String containing the content of getRequestURI() optionally followed by the query string.
    • getMethod

      String getMethod()
      Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
      Returns:
      a String with the method name
    • getHeader

      String getHeader(String name)
      Returns the value of the specified request header as a String. If the request did not include a header of the specified name, this method returns null. If there are multiple headers with the same name, this method returns the first header in the request.

      Case sensitivity is handled by the technology-specific request object.

      This is equivalent to javax.servlet.http.HttpServletRequest.getHeader().

      Parameters:
      name - a String specifying the header name
      Returns:
      a String containing the value of the requested header, or null if the request does not have a header of that name
    • getRequestObject

      Object getRequestObject()
      Returns the technology-specific request object.
      Returns:
      For servlet containers, a javax.servlet.http.HttpServletRequest, for Netty-HTTP/1 a io.netty.handler.codec.http.HttpRequest, for Netty-HTTP/2 a io.netty.handler.codec.http2.Http2Headers object