Interface BodyContent


public interface BodyContent
Content of request or response body used for adapting to beans.

This is not used for streaming content.

  • Method Summary

    Modifier and Type
    Method
    Description
    asJson(byte[] content)
    Create BodyContent for JSON byte[] content.
    byte[]
    Return the content as bytes.
    Return the content as UTF8 string.
    Return the content type.
    of(byte[] content)
    Create BodyContent with the given byte[] content.
    of(String content)
    Create BodyContent with the given string content.
    of(String contentType, byte[] content)
    Create BodyContent with the given the content type and byte[] content.
    of(String contentType, String content)
    Create BodyContent with the given the content type and string content.
  • Method Details

    • of

      static BodyContent of(byte[] content)
      Create BodyContent with the given byte[] content.
    • of

      static BodyContent of(String content)
      Create BodyContent with the given string content.
    • of

      static BodyContent of(String contentType, String content)
      Create BodyContent with the given the content type and string content.
    • of

      static BodyContent of(String contentType, byte[] content)
      Create BodyContent with the given the content type and byte[] content.
    • asJson

      static BodyContent asJson(byte[] content)
      Create BodyContent for JSON byte[] content.
    • contentType

      String contentType()
      Return the content type.
    • content

      byte[] content()
      Return the content as bytes.
    • contentAsUtf8

      String contentAsUtf8()
      Return the content as UTF8 string.