com.holonplatform.http

## Interface HttpRequest

- All Superinterfaces:
    HttpHeaders, HttpMessage<String>, Message<String,List<String>>, MessageHeaders<List<String>>
  All Known Subinterfaces:
    ServletHttpRequest

      public interface HttpRequest
      extends HttpMessage<String>

  Represents a generic HTTP request
  Since:
    5.0.0

- - ### Field Summary

    - ### Fields inherited from interface com.holonplatform.http.HttpHeaders

      `ACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ACCEPT_RANGES, AGE, ALLOW, AUTHORIZATION, CACHE_CONTROL, CONNECTION, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_RANGE, CONTENT_TYPE, COOKIE, DATE, ETAG, EXPECT, EXPIRES, FROM, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_RANGE, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LINK, LOCATION, MAX_FORWARDS, ORIGIN, PRAGMA, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, RANGE, REFERER, RETRY_AFTER, SCHEME_BASIC, SCHEME_BEARER, SCHEME_DIGEST, SERVER, SET_COOKIE, TRAILER, TRANSFER_ENCODING, UPGRADE, USER_AGENT, VARY, VIA, WARNING, WWW_AUTHENTICATE`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `InputStream` | `getBody()` Get request body input stream
    `HttpMethod` | `getMethod()` Get the request method
    `Optional<List<String>>` | `getMultiValueRequestParameter(String name)` Get a request URI query parameter by name as multi-value
    `Optional<Cookie>` | `getRequestCookie(String name)` Get a request Cookie by name
    `String` | `getRequestHost()` Get the fully qualified name of the client host or the last proxy that sent the request.
    `Optional<String>` | `getRequestParameter(String name)` Get a request URI query parameter by name.
    `Map<String,List<String>>` | `getRequestParameters()` Get all request URI query parameters
    `String` | `getRequestPath()` Get the path of the current request relative to the base URI as a string

    - ### Methods inherited from interface com.holonplatform.http.HttpMessage

      `getProtocol`

    - ### Methods inherited from interface com.holonplatform.core.messaging.Message

      `getPayload, getPayloadType`

    - ### Methods inherited from interface com.holonplatform.http.HttpHeaders

      `getAuthorizationBasicCredentials, getAuthorizationBearer, getContentLength, getDate, getHeaderValue, getLocale, getLocales, getLocation`

    - ### Methods inherited from interface com.holonplatform.core.messaging.MessageHeaders

      `getHeader, getHeaders`

- - ### Method Detail

    - #### getMethod

          HttpMethod getMethod()

      Get the request method
      Returns:
        Request method

    - #### getRequestPath

          String getRequestPath()

      Get the path of the current request relative to the base URI as a string
      Returns:
        The relative URI path (may be null)

    - #### getRequestHost

          String getRequestHost()

      Get the fully qualified name of the client host or the last proxy that sent the request.
      Returns:
        The request host

    - #### getRequestParameter

          Optional<String> getRequestParameter(String name)

      Get a request URI query parameter by name. If parameter is multi-value, the values are joined together and separated by a ',' character.
      Parameters:
        `name` - Parameter name
      Returns:
        Parameter value, or an empty Optional if not found

    - #### getMultiValueRequestParameter

          Optional<List<String>> getMultiValueRequestParameter(String name)

      Get a request URI query parameter by name as multi-value
      Parameters:
        `name` - Parameter name
      Returns:
        Parameter values, or an empty Optional if not found

    - #### getRequestParameters

          Map<String,List<String>> getRequestParameters()

      Get all request URI query parameters
      Returns:
        Map of query parameters names and values

    - #### getRequestCookie

          Optional<Cookie> getRequestCookie(String name)

      Get a request Cookie by name
      Parameters:
        `name` - Cookie name (not null)
      Returns:
        Cookie with given name, or an empty Optional if not present

    - #### getBody

          InputStream getBody()
                       throws IOException,
                              UnsupportedOperationException

      Get request body input stream
      Returns:
        Request body input stream
      Throws:
        `IOException` - I/O error
        `UnsupportedOperationException` - If underlying concrete implementation does not support message content access

Copyright © 2019 The Holon Platform. All rights reserved.