RoutingApplicationRequest

class RoutingApplicationRequest : ApplicationRequest

Represents an application request being handled by Routing

Constructors

<init>

RoutingApplicationRequest(
    call: RoutingApplicationCall,
    pipeline: ApplicationReceivePipeline,
    request: ApplicationRequest)

Represents an application request being handled by Routing

Properties

call

ApplicationCall instance this ApplicationRequest is attached to

pipeline

Pipeline for receiving content

Extension Properties

httpMethod

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

httpVersion

val ApplicationRequest.httpVersion: String

Request’s HTTP version

javaSecurityPrincipal

val ApplicationRequest.javaSecurityPrincipal: Principal?

Returns Java’s JAAS Principal

origin

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

uri

Request’s URI (including query string)

Extension 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

basicAuthenticationCredentials

fun ApplicationRequest.basicAuthenticationCredentials(
    charset: Charset? = null
): UserPasswordCredential?

Retrieves Basic authentication credentials for this ApplicationRequest

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

parseAuthorizationHeader

fun ApplicationRequest.parseAuthorizationHeader(): HttpAuthHeader?

Parses an authorization header from a ApplicationRequest returning a HttpAuthHeader.

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

toLogString

fun ApplicationRequest.toLogString(): String

Generates a string representing this ApplicationRequest suitable for logging

userAgent

fun ApplicationRequest.userAgent(): String?

Request’s User-Agent header value