Skip to main content

InvirtRequestContext

request

Returns the Request object for the current HTTP transaction.

println(InvirtRequestContext.request!!.uri)

http4kRequestContexts

Invirt uses http4k's RequestContexts to store various information about the request, including validation errors and authentication principal in the security module.

Please note that at the time of this writing, http4k's only supports one instance of RequestContexts per application. This means that if you are using Invirt you cannot create your custom RequestContexts instance and must use the one provided by Invirt.

val http4kRequestContexts = RequestContexts()

validationErrors

Returns the validation errors for the current request. This is used internally by Invirt to store validation errors and enable for them to be used in Pebble templates.

val errors: ValidationErrors?