public class TextContent
extends ByteArrayContent
Represents a text content that could be sent
OutgoingContent.ByteArrayContent, OutgoingContent.NoContent, OutgoingContent.ProtocolUpgrade, OutgoingContent.ReadChannelContent, OutgoingContent.WriteChannelContent| Constructor and Description |
|---|
TextContent(java.lang.String text,
ContentType contentType,
HttpStatusCode status)
Represents a text content that could be sent
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
bytes()
Provides ByteArray which engine will send to peer
|
java.lang.Long |
getContentLength()
Specifies content length in bytes for this resource.
|
ContentType |
getContentType()
Specifies
|
HttpStatusCode |
getStatus()
Status code to set when sending this content
|
java.lang.String |
getText()
to be sent
|
java.lang.String |
toString() |
bytesgetContentLength, getContentType, getHeaders, getProperty, getStatus, setPropertypublic TextContent(java.lang.String text,
ContentType contentType,
HttpStatusCode status)
Represents a text content that could be sent
text - to be sentcontentType - Specifies class ContentType for this resource.status - Status code to set when sending this contentpublic java.lang.Long getContentLength()
Specifies content length in bytes for this resource.
If null, the resources will be sent as Transfer-Encoding: chunked
public java.lang.String toString()
public java.lang.String getText()
to be sent
public ContentType getContentType()
Specifies
class ContentType for this resource.
class ContentTypepublic HttpStatusCode getStatus()
Status code to set when sending this content