Class SimpleBody

java.lang.Object
org.apache.hc.client5.http.async.methods.SimpleBody

public final class SimpleBody extends Object
Message body representation as a simple text string or an array of bytes.
Since:
5.0
  • Field Details

    • bodyAsBytes

      private final byte[] bodyAsBytes
    • bodyAsText

      private final String bodyAsText
    • contentType

      private final org.apache.hc.core5.http.ContentType contentType
  • Constructor Details

    • SimpleBody

      SimpleBody(byte[] bodyAsBytes, String bodyAsText, org.apache.hc.core5.http.ContentType contentType)
  • Method Details

    • create

      static SimpleBody create(String body, org.apache.hc.core5.http.ContentType contentType)
    • create

      static SimpleBody create(byte[] body, org.apache.hc.core5.http.ContentType contentType)
    • getContentType

      public org.apache.hc.core5.http.ContentType getContentType()
    • getBodyBytes

      public byte[] getBodyBytes()
    • getBodyText

      public String getBodyText()
    • isText

      public boolean isText()
    • isBytes

      public boolean isBytes()
    • toString

      public String toString()
      Overrides:
      toString in class Object