Package-level declarations

Types

Link copied to clipboard

An adapter from CIO low-level headers map to ktor Headers interface

Link copied to clipboard
class CIOMultipartDataBase(val coroutineContext: CoroutineContext, channel: ByteReadChannel, contentType: CharSequence, contentLength: Long?, formFieldLimit: Int = 65536) : MultiPartData, CoroutineScope

Represents a multipart data object that does parse and convert parts to ktor's PartData

Link copied to clipboard
class ConnectionOptions(val close: Boolean = false, val keepAlive: Boolean = false, val upgrade: Boolean = false, val extraOptions: List<String> = emptyList())

Represents a parsed Connection header

Link copied to clipboard
typealias DecoderJob = WriterJob

Decoder job type

Link copied to clipboard
typealias EncoderJob = ReaderJob

Encoder job type

Link copied to clipboard

A headers map data structure used in CIO

Link copied to clipboard
abstract class HttpMessage : Closeable

Represents a base HTTP message type for request and response

Link copied to clipboard
sealed class MultipartEvent

Represents a multipart content starting event. Every part need to be completely consumed or released via release

Link copied to clipboard

An HTTP parser exception

Link copied to clipboard

Represents an HTTP request

Link copied to clipboard

Builds an HTTP request or response

Builds an HTTP request or response

Builds an HTTP request or response

Builds an HTTP request or response

Link copied to clipboard

Represents an HTTP response

Functions

Link copied to clipboard

Decode chunked transfer encoding from the input channel and write the result in out.

Link copied to clipboard
fun CoroutineScope.decodeChunked(input: ByteReadChannel): DecoderJob
fun CoroutineScope.decodeChunked(input: ByteReadChannel, contentLength: Long): DecoderJob

Start a chunked stream decoder coroutine

Link copied to clipboard
suspend fun encodeChunked(output: ByteWriteChannel, input: ByteReadChannel)

Chunked stream encoding loop

suspend fun encodeChunked(output: ByteWriteChannel, coroutineContext: CoroutineContext): EncoderJob

Start chunked stream encoding coroutine

Link copied to clipboard
fun expectHttpBody(method: HttpMethod, contentLength: Long, transferEncoding: CharSequence?, connectionOptions: ConnectionOptions?, contentType: CharSequence?): Boolean
Link copied to clipboard
fun expectHttpUpgrade(method: HttpMethod, upgrade: CharSequence?, connectionOptions: ConnectionOptions?): Boolean
Link copied to clipboard

Parse http headers. Not applicable to request and response status lines.

Link copied to clipboard
suspend fun parseHttpBody(headers: HttpHeadersMap, input: ByteReadChannel, out: ByteWriteChannel)

Parse HTTP request or response body using request/response's headers writing it to out. Usually doesn't fail but closing out channel with error.

suspend fun parseHttpBody(contentLength: Long, transferEncoding: CharSequence?, connectionOptions: ConnectionOptions?, input: ByteReadChannel, out: ByteWriteChannel)
suspend fun parseHttpBody(version: HttpProtocolVersion?, contentLength: Long, transferEncoding: CharSequence?, connectionOptions: ConnectionOptions?, input: ByteReadChannel, out: ByteWriteChannel)

Parse HTTP request or response body using contentLength, transferEncoding and connectionOptions writing it to out. Usually doesn't fail but closing out channel with error.

Link copied to clipboard
fun CoroutineScope.parseMultipart(input: ByteReadChannel, headers: HttpHeadersMap): ReceiveChannel<MultipartEvent>
fun CoroutineScope.parseMultipart(input: ByteReadChannel, contentType: CharSequence, contentLength: Long?): ReceiveChannel<MultipartEvent>

Starts a multipart parser coroutine producing multipart events

Link copied to clipboard
suspend fun parseRequest(input: ByteReadChannel): Request?

Parse an HTTP request line and headers

Link copied to clipboard
suspend fun parseResponse(input: ByteReadChannel): Response?

Parse an HTTP response status line and headers