com.holonplatform.http.rest

## Interface RequestEntity<T>

- Type Parameters:
    `T` - Entity type

      public interface RequestEntity<T>

  HTTP request message entity (payload) representation.
  See Also:
    `RestClient`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `RequestEntity.FormBuilder` Builder to create form type entity payloads.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static RequestEntity<Void>` | `EMPTY` Empty request entity (with no payload and media type)

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> RequestEntity<T>` | `build(String mediaType, T payload)` Build a RequestEntity.
    `static RequestEntity<Map<String,List<String>>>` | `form(Map<String,List<String>> formData)` Build a `MediaType.APPLICATION_FORM_URLENCODED` entity
    `static RequestEntity.FormBuilder` | `formBuilder()` Gets a `RequestEntity.FormBuilder` to build form parameters name-value(s) map to be used with form data type entity.
    `Optional<String>` | `getMediaType()` Get entity media type, if specified
    `Optional<T>` | `getPayload()` Get entity payload, if available
    `static <T> RequestEntity<T>` | `json(T payload)` Build a `MediaType.APPLICATION_JSON` entity.
    `static <T> RequestEntity<T>` | `text(T payload)` Build a `MediaType.TEXT_PLAIN` entity.
    `static <T> RequestEntity<T>` | `xml(T payload)` Build a `MediaType.APPLICATION_XML` entity.

- - ### Field Detail

    - #### EMPTY

          static final RequestEntity<Void> EMPTY

      Empty request entity (with no payload and media type)

  - ### Method Detail

    - #### getMediaType

          Optional<String> getMediaType()

      Get entity media type, if specified
      Returns:
        Media type

    - #### getPayload

          Optional<T> getPayload()

      Get entity payload, if available
      Returns:
        Entity payload

    - #### build

          static <T> RequestEntity<T> build(String mediaType,
                                            T payload)

      Build a RequestEntity.
      Type Parameters:
        `T` - Payload type
      Parameters:
        `mediaType` - Media type
        `payload` - Entity payload
      Returns:
        RequestEntity

    - #### text

          static <T> RequestEntity<T> text(T payload)

      Build a `MediaType.TEXT_PLAIN` entity.
      Type Parameters:
        `T` - Payload type
      Parameters:
        `payload` - Entity payload
      Returns:
        RequestEntity

    - #### xml

          static <T> RequestEntity<T> xml(T payload)

      Build a `MediaType.APPLICATION_XML` entity.
      Type Parameters:
        `T` - Payload type
      Parameters:
        `payload` - Entity payload
      Returns:
        RequestEntity

    - #### json

          static <T> RequestEntity<T> json(T payload)

      Build a `MediaType.APPLICATION_JSON` entity.
      Type Parameters:
        `T` - Payload type
      Parameters:
        `payload` - Entity payload
      Returns:
        RequestEntity

    - #### form

          static RequestEntity<Map<String,List<String>>> form(Map<String,List<String>> formData)

      Build a `MediaType.APPLICATION_FORM_URLENCODED` entity
      Parameters:
        `formData` - Form data name-value(s) map
      Returns:
        RequestEntity

    - #### formBuilder

          static RequestEntity.FormBuilder formBuilder()

      Gets a `RequestEntity.FormBuilder` to build form parameters name-value(s) map to be used with form data type entity.
      Returns:
        FormBuilder
      See Also:
        `form(Map)`

Copyright © 2017 The Holon Platform. All rights reserved.