Package io.ktor.server.plugins

Types

Link copied to clipboard
open class BadRequestException(message: String, cause: Throwable?) : Exception

Base exception to indicate that the request is not correct due to wrong/missing request parameters, body content or header values. Throwing this exception in a handler will lead to 400 Bad Request response unless a custom io.ktor.plugins.StatusPages handler registered.

Link copied to clipboard
Link copied to clipboard
abstract class ContentTransformationException(message: String) : Exception

Thrown when content cannot be transformed to the desired type. It is not defined which status code will be replied when an exception of this type is thrown and not caught. Depending on child type it could be 4xx or 5xx status code. By default it will be 500 Internal Server Error.

Link copied to clipboard
class MissingRequestParameterException(parameterName: String) : BadRequestException, CopyableThrowable<MissingRequestParameterException>

This exception is thrown when a required parameter with name parameterName is missing

Link copied to clipboard
class MutableOriginConnectionPoint

Represents a RequestConnectionPoint. Its every component is mutable so application plugins could modify them. By default all the properties are equal to ApplicationRequest.local with RequestConnectionPoint.host and RequestConnectionPoint.port overridden by HttpHeaders.Host header value. Users can assign new values parsed from HttpHeaders.Forwarded, HttpHeaders.XForwardedHost, etc. See XForwardedHeaders and ForwardedHeaders.

Link copied to clipboard
class NotFoundException(message: String?) : Exception

This exception means that the requested resource is not found. HTTP status 404 Not found will be replied when this exception is thrown and not caught. 404 status page could be configured by registering a custom io.ktor.plugins.StatusPages handler.

Link copied to clipboard
class ParameterConversionException(parameterName: String, type: String, cause: Throwable?) : BadRequestException, CopyableThrowable<ParameterConversionException>

This exception is thrown when a required parameter with name parameterName couldn't be converted to the type

Link copied to clipboard
class UnsupportedMediaTypeException(contentType: <ERROR CLASS>) : ContentTransformationException, CopyableThrowable<UnsupportedMediaTypeException>

Thrown when there is no conversion for a content type configured. HTTP status 415 Unsupported Media Type will be replied when this exception is thrown and not caught.

Properties

Link copied to clipboard

Returns MutableOriginConnectionPoint associated with this call

Link copied to clipboard
val MutableOriginConnectionPointKey: <ERROR CLASS><MutableOriginConnectionPoint>

A key to install a mutable RequestConnectionPoint

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