ApplicationRequest

interface ApplicationRequest

A client's request. To learn how to handle incoming requests, see Handling requests.

See also

Functions

Link copied to clipboard
abstract fun receiveChannel(): <ERROR CLASS>

Receives a raw body payload as a channel.

Properties

Link copied to clipboard
abstract val call: ApplicationCall

An ApplicationCall instance this ApplicationRequest is attached to.

Link copied to clipboard
abstract val cookies: RequestCookies

Provides access to cookies for this request.

Link copied to clipboard
abstract val headers: <ERROR CLASS>

Provides access to headers for the current request. You can also get access to specific headers using dedicated extension functions, such as acceptEncoding, contentType, cacheControl, and so on.

Link copied to clipboard
abstract val local: <ERROR CLASS>

Provides access to connection details such as a host name, port, scheme, and so on. To get information about a request passed through an HTTP proxy or a load balancer, install the ForwardedHeaders/XForwardedHeader plugin and use the origin property.

Link copied to clipboard
abstract val pipeline: ApplicationReceivePipeline

A pipeline for receiving content.

Link copied to clipboard
abstract val queryParameters: <ERROR CLASS>

Provides access to decoded parameters of a URL query string.

Link copied to clipboard
abstract val rawQueryParameters: <ERROR CLASS>

Provides access to parameters of a URL query string.

Inheritors

Link copied to clipboard

Extensions

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

Get a request's Accept header value.

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

Gets a request's Accept-Charset header value.

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

Gets the Accept-Charset header charsets sorted according to their qualities.

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

Gets a request's Accept-Encoding header value.

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

Gets the Accept-Encoding header encoding types sorted according to their qualities.

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

Gets the Accept header content types sorted according to their qualities.

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

Gets a request's Accept-Language header value.

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

Gets the Accept-Language header languages sorted according to their qualities.

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

Get a request's Authorization header value.

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

Gets a request's Cache-Control header value.

Link copied to clipboard
fun ApplicationRequest.contentCharset(): <ERROR CLASS>?

Gets a request's charset.

Link copied to clipboard
fun ApplicationRequest.contentLength(): Long?

Gets a request's Content-Length header value.

Link copied to clipboard
fun ApplicationRequest.contentType(): <ERROR CLASS>

Gets a request's content type or returns ContentType.Any.

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

A document name is a substring after the last slash but before a query string.

Link copied to clipboard
fun ApplicationRequest.encodeParameters(parameters: <ERROR CLASS>): <ERROR CLASS>

Internal helper function to encode raw parameters. Should not be used directly.

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

Gets the first value of a name header or returns null if missing.

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

Gets a request's host value without a port.

Link copied to clipboard
val ApplicationRequest.httpMethod: <ERROR CLASS>

Gets a request HTTP method possibly overridden using the X-Http-Method-Override header.

Link copied to clipboard
val ApplicationRequest.httpVersion: String

Gets a request's HTTP version.

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

Checks whether a request's body is chunk-encoded.

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

Checks whether a request body is multipart-encoded.

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

Get a request's Location header value.

Link copied to clipboard
val ApplicationRequest.origin: <ERROR CLASS>

Represents request and connection parameters possibly overridden via https headers. By default it fallbacks to ApplicationRequest.local

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

Get a request's URL path without a query string.

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

Gets a request's port extracted from the Host header value.

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

Gets a request's query string or returns an empty string if missing.

Link copied to clipboard
fun ApplicationRequest.ranges(): <ERROR CLASS>?

Gets ranges parsed from a request's Range header value.

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

Generates a string representing this ApplicationRequest suitable for logging

Link copied to clipboard
val ApplicationRequest.uri: String

Gets a request's URI, including a query string.

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

Gets a request's User-Agent header value.