Package io.ktor.request

Types

Link copied to clipboard
open class ApplicationReceivePipeline(developmentMode: Boolean) : Pipeline<ApplicationReceiveRequest, ApplicationCall>

Pipeline for processing incoming content

Link copied to clipboard
class ApplicationReceiveRequest(typeInfo: KType, value: Any, reusableValue: Boolean)

Represents a subject for ApplicationReceivePipeline

Link copied to clipboard
interface ApplicationRequest

Represents client's request

Link copied to clipboard

Thrown when content cannot be transformed to the desired type.

Link copied to clipboard
class RequestAlreadyConsumedException : IllegalStateException

Thrown when a request body has already been received. Usually it is caused by double ApplicationCall.receive invocation.

Link copied to clipboard
open class RequestCookies(request: ApplicationRequest)

Server request's cookies

Functions

Link copied to clipboard
fun ApplicationRequest.accept(): String?

Request's Accept header value

Link copied to clipboard
fun ApplicationRequest.acceptCharset(): String?

Request's Accept-Charset header value

Link copied to clipboard
fun ApplicationRequest.acceptCharsetItems(): List<HeaderValue>

Parsed and sorted request's Accept-Charset header value

Link copied to clipboard
fun ApplicationRequest.acceptEncoding(): String?

Request's Accept-Encoding header value

Link copied to clipboard
fun ApplicationRequest.acceptEncodingItems(): List<HeaderValue>

Parsed and sorted request's Accept-Encoding header value

Link copied to clipboard
fun ApplicationRequest.acceptItems(): List<HeaderValue>

Parsed request's Accept header and sorted according to quality

Link copied to clipboard
fun ApplicationRequest.acceptLanguage(): String?

Request's Accept-Language header value

Link copied to clipboard
fun ApplicationRequest.acceptLanguageItems(): List<HeaderValue>

Parsed and sorted request's Accept-Language header value

Link copied to clipboard
fun ApplicationRequest.authorization(): String?

Request authorization header value

Link copied to clipboard
fun ApplicationRequest.cacheControl(): String?

Request's Cache-Control header value

Link copied to clipboard
fun ApplicationRequest.contentCharset(): Charset?

Request's charset

Link copied to clipboard
fun ApplicationRequest.contentType(): ContentType

Request's content type or ContentType.Any

Link copied to clipboard
fun ApplicationRequest.document(): String

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

Link copied to clipboard
fun ApplicationRequest.header(name: String): String?

First header value for header with name or null if missing

Link copied to clipboard
fun ApplicationRequest.host(): String

Request's host without port

Link copied to clipboard
fun ApplicationRequest.isChunked(): Boolean

Check if request's body is chunk-encoded

Link copied to clipboard
fun ApplicationRequest.isMultipart(): Boolean

Check if request body is multipart-encoded

Link copied to clipboard
fun ApplicationRequest.location(): String?

Request's Location header value

Link copied to clipboard
fun ApplicationRequest.path(): String

Request's path without query string

Link copied to clipboard
fun ApplicationRequest.port(): Int

Request's port extracted from Host header value

Link copied to clipboard
fun ApplicationRequest.queryString(): String

Request's query string or empty string if missing

Link copied to clipboard
fun ApplicationRequest.ranges(): RangesSpecifier?

Parsed request's Range header value

Link copied to clipboard
inline suspend fun <T : Any> ApplicationCall.receive(): T
suspend fun <T : Any> ApplicationCall.receive(type: KClass<T>): T
suspend fun <T : Any> ApplicationCall.receive(type: KType): T

Receives content for this request.

Link copied to clipboard
inline suspend fun ApplicationCall.receiveChannel(): ByteReadChannel

Receives channel content for this call.

Link copied to clipboard
inline suspend fun ApplicationCall.receiveMultipart(): MultiPartData

Receives multipart data for this call.

Link copied to clipboard
inline suspend fun <T : Any> ApplicationCall.receiveOrNull(): T?
suspend fun <T : Any> ApplicationCall.receiveOrNull(type: KClass<T>): T?
suspend fun <T : Any> ApplicationCall.receiveOrNull(type: KType): T?

Receives content for this request.

Link copied to clipboard
inline suspend fun ApplicationCall.receiveParameters(): Parameters

Receives form parameters for this call.

Link copied to clipboard
inline suspend fun ApplicationCall.receiveStream(): InputStream

Receives stream content for this call.

Link copied to clipboard
inline suspend fun ApplicationCall.receiveText(): String

Receives incoming content for this call as String.

Link copied to clipboard
fun ApplicationRequest.userAgent(): String?

Request's User-Agent header value

Properties

Link copied to clipboard
val ApplicationRequest.httpMethod: HttpMethod

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

Link copied to clipboard
val ApplicationRequest.httpVersion: String

Request's HTTP version

Link copied to clipboard
val ApplicationRequest.uri: String

Request's URI (including query string)