Class SimpleBody
- java.lang.Object
-
- org.apache.hc.client5.http.async.methods.SimpleBody
-
public final class SimpleBody extends java.lang.Object
Message body representation as a simple text string or an array of bytes.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
bodyAsBytes
private java.lang.String
bodyAsText
private org.apache.hc.core5.http.ContentType
contentType
-
Constructor Summary
Constructors Constructor Description SimpleBody(byte[] bodyAsBytes, java.lang.String bodyAsText, org.apache.hc.core5.http.ContentType contentType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static SimpleBody
create(byte[] body, org.apache.hc.core5.http.ContentType contentType)
(package private) static SimpleBody
create(java.lang.String body, org.apache.hc.core5.http.ContentType contentType)
byte[]
getBodyBytes()
java.lang.String
getBodyText()
org.apache.hc.core5.http.ContentType
getContentType()
boolean
isBytes()
boolean
isText()
java.lang.String
toString()
-
-
-
Method Detail
-
create
static SimpleBody create(java.lang.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 java.lang.String getBodyText()
-
isText
public boolean isText()
-
isBytes
public boolean isBytes()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-