TextContent

class TextContent(text: String, contentType: ContentType, status: HttpStatusCode?) : OutgoingContent.ByteArrayContent

Represents a text content that could be sent

Constructors

Link copied to clipboard
fun TextContent(text: String, contentType: ContentType, status: HttpStatusCode? = null)

Functions

Link copied to clipboard
open override fun bytes(): ByteArray

Provides ByteArray which engine will send to peer

Link copied to clipboard
open fun <T : Any> getProperty(key: AttributeKey<T>): T?

Gets an extension property for this content

Link copied to clipboard
open fun <T : Any> setProperty(key: AttributeKey<T>, value: T?)

Sets an extension property for this content

Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
open override val contentLength: Long

Specifies content length in bytes for this resource.

Link copied to clipboard
open override val contentType: ContentType

Specifies ContentType for this resource.

Link copied to clipboard
open val headers: Headers

Headers to set when sending this content

Link copied to clipboard
open override val status: HttpStatusCode? = null

Status code to set when sending this content

Link copied to clipboard
val text: String

to be sent