Package-level declarations

Types

Link copied to clipboard
class ByteArrayContent(bytes: ByteArray, val contentType: ContentType? = null, val status: HttpStatusCode? = null) : OutgoingContent.ByteArrayContent

Implementation of the OutgoingContent.ByteArrayContent for sending array of bytes

Link copied to clipboard
data class CachingOptions(val cacheControl: CacheControl? = null, val expires: GMTDate? = null)

Specifies caching properties for OutgoingContent such as Cache-Control or Expires.

Link copied to clipboard
class ChannelWriterContent(body: suspend ByteWriteChannel.() -> Unit, val contentType: ContentType?, val status: HttpStatusCode? = null, val contentLength: Long? = null) : OutgoingContent.WriteChannelContent

OutgoingContent to respond with ByteWriteChannel. The stream would be automatically closed after body finish.

Link copied to clipboard
data class EntityTagVersion(val etag: String, val weak: Boolean) : Version

This version checks the etag value and pass it through conditions supplied by the remote client. Depending on the conditions, it produces the return value of enum type VersionCheckResult.

Link copied to clipboard
data class LastModifiedVersion(val lastModified: GMTDate) : Version

Creates an instance of LastModifiedVersion that passes the given lastModified date through the If-Modified-Since and If-Unmodified-Since conditional headers provided by the client.

Link copied to clipboard
interface MultiPartData

Represents a multipart data stream that could be received from a call.

Link copied to clipboard
object NullBody

A subject of pipeline when body of HTTP message is null

Link copied to clipboard
sealed class OutgoingContent

Information about the content to be sent to the peer, recognized by a client or server engine

Link copied to clipboard
class OutputStreamContent(body: suspend OutputStream.() -> Unit, val contentType: ContentType, val status: HttpStatusCode? = null, val contentLength: Long? = null) : OutgoingContent.WriteChannelContent

OutgoingContent to respond with OutputStream. The stream would be automatically closed after body finish.

Link copied to clipboard
sealed class PartData

Represents a multipart/form-data entry. Could be a FormItem or FileItem.

Link copied to clipboard
class TextContent(val text: String, val contentType: ContentType, val status: HttpStatusCode? = null) : OutgoingContent.ByteArrayContent

Represents a text content that could be sent

Link copied to clipboard
class URIFileContent(val uri: URI, val contentType: ContentType = ContentType.defaultForFilePath(uri.path), val contentLength: Long? = null) : OutgoingContent.ReadChannelContent

Represents a content that is served from the specified uri

Link copied to clipboard
interface Version

A content version.

Link copied to clipboard

Represent the result of the version comparison between content being sent and HTTP request.

Link copied to clipboard
class WriterContent(body: suspend Writer.() -> Unit, val contentType: ContentType, val status: HttpStatusCode? = null, val contentLength: Long? = null) : OutgoingContent.WriteChannelContent

Represents a content that is produced by body function

Properties

Link copied to clipboard

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

Link copied to clipboard

Specifies a key for the CacheControl extension property for OutgoingContent.

Link copied to clipboard

Provides file item's content as an InputStream

Link copied to clipboard

Specifies a key for the VersionList extension property for OutgoingContent.

Link copied to clipboard

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

Functions

Link copied to clipboard
fun OutgoingContent.compressed(contentEncoder: ContentEncoder, coroutineContext: CoroutineContext = EmptyCoroutineContext): OutgoingContent?

Returns OutgoingContent compressed with contentEncoder if possible.

Link copied to clipboard
Link copied to clipboard
suspend fun MultiPartData.forEachPart(partHandler: suspend (PartData) -> Unit)

Parse multipart data stream and invoke partHandler for each PartData encountered.

Link copied to clipboard

Check if current OutgoingContent doesn't contain content

Link copied to clipboard

This version passes the given lastModified date through the client provided http conditional headers If-Modified-Since and If-Unmodified-Since.

Link copied to clipboard

Parse multipart data stream and put all parts into a list.