Interface BodyAdapter

All Known Implementing Classes:
BodyAdapterImpl

public interface BodyAdapter
The BodyAdapter interface defines methods for adapting the body of an HTTP request to various formats. This interface is designed to implement the Adapter pattern.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the body of the HTTP request as a string.
    Returns the body of the HTTP request as a map of form data.
    Returns the body of the HTTP request in JSON format.
    modelFormat(Class<?> model)
    Returns the body of the HTTP request in a format that can be used to create an object of the given model class.
    Returns the body of the HTTP request in URL-encoded format.
  • Method Details

    • body

      String body()
      Returns the body of the HTTP request as a string.
      Returns:
      the body of the HTTP request as a string
    • formData

      Map<String,String> formData()
      Returns the body of the HTTP request as a map of form data.
      Returns:
      the body of the HTTP request as a map of form data
    • jsonFormat

      String jsonFormat()
      Returns the body of the HTTP request in JSON format.
      Returns:
      the body of the HTTP request in JSON format
    • urlEncodedFormat

      String urlEncodedFormat()
      Returns the body of the HTTP request in URL-encoded format.
      Returns:
      the body of the HTTP request in URL-encoded format
    • modelFormat

      Object modelFormat(Class<?> model)
      Returns the body of the HTTP request in a format that can be used to create an object of the given model class.
      Parameters:
      model - the class of the model that the body will be adapted to
      Returns:
      the body of the HTTP request in a format that can be used to create an object of the given model class