Top Description Fields Constructors Methods
org.apache.hc.client5.http.async.methods

public final Class SimpleBody

extends Object
Class Inheritance
Imports
java.nio.charset.Charset, .StandardCharsets, org.apache.hc.core5.http.ContentType, org.apache.hc.core5.util.Args

Message body representation as a simple text string or an array of bytes.
Since
5.0

Field Summary

Modifier and TypeField and Description
private final byte[]
private final String
private final ContentType

Constructor Summary

AccessConstructor and Description
pack-priv
SimpleBody(final byte[] bodyAsBytes, final String bodyAsText, final ContentType contentType)

Method Summary

Modifier and TypeMethod and Description
pack-priv static SimpleBody
create(final String body, final ContentType contentType)

pack-priv static SimpleBody
create(final byte[] body, final ContentType contentType)

public byte[]
public String
public ContentType
public boolean
public boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bodyAsBytesback to summary
private final byte[] bodyAsBytes
bodyAsTextback to summary
private final String bodyAsText
contentTypeback to summary
private final ContentType contentType

Constructor Detail

SimpleBodyback to summary
pack-priv SimpleBody(final byte[] bodyAsBytes, final String bodyAsText, final ContentType contentType)

Method Detail

createback to summary
pack-priv static SimpleBody create(final String body, final ContentType contentType)
createback to summary
pack-priv static SimpleBody create(final byte[] body, final ContentType contentType)
getBodyBytesback to summary
public byte[] getBodyBytes()
getBodyTextback to summary
public String getBodyText()
getContentTypeback to summary
public ContentType getContentType()
isBytesback to summary
public boolean isBytes()
isTextback to summary
public boolean isText()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override