ServletApplicationRequest

abstract class ServletApplicationRequest : 
    BaseApplicationRequest

Constructors

<init>

ServletApplicationRequest(
    call: ApplicationCall,
    servletRequest: HttpServletRequest)

Properties

cookies

open val cookies: RequestCookies

Cookies for this request

headers

open val headers: Headers

Headers for this request

local

open val local: RequestConnectionPoint

Contains http request and connection details such as a host name used to connect, port, scheme and so on. No proxy headers could affect it. Use ApplicationRequest.origin if you need override headers support

queryParameters

open val queryParameters: Parameters

Parameters provided in an URL

servletRequest

val servletRequest: HttpServletRequest

Inherited Properties

call

val call: ApplicationCall

ApplicationCall instance this ApplicationRequest is attached to

pipeline

open val pipeline: ApplicationReceivePipeline

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

servletRequestAttributes

val ApplicationRequest.servletRequestAttributes: Map<String, Any>

Provides javax.servlet request attributes or fail it the underlying engine is not servlet-backed.

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

Inheritors

AsyncServletApplicationRequest

class AsyncServletApplicationRequest : 
    ServletApplicationRequest,
    CoroutineScope