AbstractResponseDefinition

abstract class AbstractResponseDefinition<T>(val contentType: <Error class: unknown class>? = null, val httpStatus: <Error class: unknown class> = HttpStatusCode.OK, val headers: <Error class: unknown class>.() -> Unit? = null, val headerList: List<<Error class: unknown class><String, String>> = emptyList(), val delay: <Error class: unknown class> = Duration.ZERO)

Represents the base definition of an HTTP response in a mapping between a request and its corresponding response. Provides the required attributes and behavior for configuring HTTP responses, including status code, headers, and content type. This class serves as the foundation for more specialized response definitions.

Parameters

T

The type of the response data.

Inheritors

Constructors

Link copied to clipboard
constructor(contentType: <Error class: unknown class>? = null, httpStatus: <Error class: unknown class> = HttpStatusCode.OK, headers: <Error class: unknown class>.() -> Unit? = null, headerList: List<<Error class: unknown class><String, String>> = emptyList(), delay: <Error class: unknown class> = Duration.ZERO)

Properties

Link copied to clipboard
val contentType: <Error class: unknown class>? = null

The MIME type of the response content. Defaults to null.

Link copied to clipboard
open val delay: <Error class: unknown class>
Link copied to clipboard
val headerList: List<<Error class: unknown class><String, String>>

A list of header key-value pairs to populate the response headers. Defaults to an empty list.

Link copied to clipboard
val headers: <Error class: unknown class>.() -> Unit? = null

A lambda function for configuring the response headers. Defaults to null.

Link copied to clipboard
val httpStatus: <Error class: unknown class>

The HTTP status code of the response. Defaults to HttpStatusCode.OK.