ktor-http / io.ktor.http.content / TextContent

TextContent

class TextContent : ByteArrayContent

Represents a text content that could be sent

Constructors

<init>

TextContent(text: String, contentType: ContentType, status: HttpStatusCode? = null)

Represents a text content that could be sent

Properties

contentLength

val contentLength: Long

Specifies content length in bytes for this resource.

contentType

val contentType: ContentType

Specifies ContentType for this resource.

status

val status: HttpStatusCode?

Status code to set when sending this content

text

val text: String

to be sent

Functions

bytes

fun bytes(): ByteArray

Provides ByteArray which engine will send to peer

toString

fun toString(): String

Extension Properties

caching

var OutgoingContent.caching: CachingOptions?

Gets or sets CacheControl instance as an extension property on this content

versions

var OutgoingContent.versions: List<Version>

Gets or sets list of Version instances as an extension property on this content