Interface HttpRequest

All Known Implementing Classes:
UndertowRequest

public interface HttpRequest
An HTTP request.
  • Method Details

    • getCharset

      String getCharset()
      Returns the request charset.
      Returns:
      The request charset
    • getCookie

      Cookie getCookie(String cookieName)
      Returns a cookie.
      Parameters:
      cookieName - The cookie name
      Returns:
      The cookie, otherwise, null
    • acceptContentType

      boolean acceptContentType(String contentType)
      Checks if the current request accept a specific content type.
      Parameters:
      contentType - The content type
      Returns:
      true if the content type is accepted, otherwise, false
    • getHeader

      String getHeader(String headerName)
      Returns a single header.
      Parameters:
      headerName - The header name
      Returns:
      The requested header value, otherwise, a null value
    • getHeaders

      Map<String,List<String>> getHeaders()
      Returns all headers.
      Returns:
      All headers
    • getHttpMethod

      HttpMethod getHttpMethod()
      Get the HTTP request method.
      Returns:
      The request method
    • getInputSteam

      InputStream getInputSteam()
      Get the input stream to read the request. Can only be called one time.
      Returns:
      The input stream
    • getQueryString

      String getQueryString()
      Returns the query string, without the leading "?".
      Returns:
      The query string
    • getQueryStringParameter

      String getQueryStringParameter(String parameterName)
      Returns the query string parameter value.
      Parameters:
      parameterName - The parameter name
      Returns:
      The query string parameter value
    • getQueryStringParameters

      Map<String,List<String>> getQueryStringParameters()
      Returns all query string parameters.
      Returns:
      All query string parameters
    • getRemoteHostName

      String getRemoteHostName()
      Returns the remote host that this request was sent to.
      Returns:
      The remote host name
    • getRequestURL

      String getRequestURL()
      Returns the complete URL as seen by the user.
      Returns:
      The request URL
    • getRequestURI

      String getRequestURI()
      Returns the original request URI. This is not decoded in any way, and does not include the query string.
      Returns:
      The request URI
    • getBodyContent

      HttpRequestBodyContent getBodyContent()
      Returns the body content;
      Returns:
      The body content