Package io.ktor.request

Types

ApplicationReceivePipeline

open class ApplicationReceivePipeline : 
    Pipeline<ApplicationReceiveRequest, ApplicationCall>

Pipeline for processing incoming content

ApplicationReceiveRequest

class ApplicationReceiveRequest

Represents a subject for ApplicationReceivePipeline

ApplicationRequest

interface ApplicationRequest

Represents client’s request

RequestCookies

open class RequestCookies

Server request’s cookies

Type Aliases

ContentTransformationException

typealias ContentTransformationException = ContentTransformationException

Thrown when content cannot be transformed to the desired type.

Properties

httpMethod

Returns request HTTP method possibly overridden via header X-Http-Method-Override

httpVersion

val ApplicationRequest.httpVersion: String

Request’s HTTP version

uri

Request’s URI (including query string)

Functions

accept

fun ApplicationRequest.accept(): String?

Request’s Accept header value

acceptCharset

fun ApplicationRequest.acceptCharset(): String?

Request’s Accept-Charset header value

acceptCharsetItems

fun ApplicationRequest.acceptCharsetItems(): List<HeaderValue>

Parsed and sorted request’s Accept-Charset header value

acceptEncoding

fun ApplicationRequest.acceptEncoding(): String?

Request’s Accept-Encoding header value

acceptEncodingItems

fun ApplicationRequest.acceptEncodingItems(): List<HeaderValue>

Parsed and sorted request’s Accept-Encoding header value

acceptItems

fun ApplicationRequest.acceptItems(): List<HeaderValue>

Parsed request’s Accept header and sorted according to quality

acceptLanguage

fun ApplicationRequest.acceptLanguage(): String?

Request’s Accept-Language header value

acceptLanguageItems

fun ApplicationRequest.acceptLanguageItems(): List<HeaderValue>

Parsed and sorted request’s Accept-Language header value

authorization

fun ApplicationRequest.authorization(): String?

Request authorization header value

cacheControl

fun ApplicationRequest.cacheControl(): String?

Request’s Cache-Control header value

contentCharset

fun ApplicationRequest.contentCharset(): Charset?

Request’s charset

contentType

fun ApplicationRequest.contentType(): ContentType

Request’s content type or ContentType.Any

document

fun ApplicationRequest.document(): String

Request’s document name (substring after the last slash but before query string)

header

fun ApplicationRequest.header(name: String): String?

First header value for header with name or null if missing

host

Request’s host without port

isChunked

fun ApplicationRequest.isChunked(): Boolean

Check if request’s body is chunk-encoded

isMultipart

fun ApplicationRequest.isMultipart(): Boolean

Check if request body is multipart-encoded

location

fun ApplicationRequest.location(): String?

Request’s Location header value

path

Request’s path without query string

port

Request’s port extracted from Host header value

queryString

fun ApplicationRequest.queryString(): String

Request’s query string or empty string if missing

ranges

Parsed request’s Range header value

receive

suspend fun <T : Any> ApplicationCall.receive(): T
suspend fun <T : Any> ApplicationCall.receive(
    type: KClass<T>
): T

Receives content for this request.

receiveChannel

suspend fun ApplicationCall.receiveChannel(): ByteReadChannel

Receives channel content for this call.

receiveMultipart

suspend fun ApplicationCall.receiveMultipart(): MultiPartData

Receives multipart data for this call.

receiveOrNull

suspend fun <T : Any> ApplicationCall.receiveOrNull(): T?
suspend fun <T : Any> ApplicationCall.receiveOrNull(
    type: KClass<T>
): T?

Receives content for this request.

receiveParameters

suspend fun ApplicationCall.receiveParameters(): Parameters

Receives form parameters for this call.

receiveStream

suspend fun ApplicationCall.receiveStream(): InputStream

Receives stream content for this call.

receiveText

suspend fun ApplicationCall.receiveText(): String

Receives incoming content for this call as String.

userAgent

fun ApplicationRequest.userAgent(): String?

Request’s User-Agent header value