AbstractResponseDefinitionBuilder

abstract class AbstractResponseDefinitionBuilder<P, T>(var delay: Duration = Duration.ZERO)(source)

Represents a base abstraction for defining the attributes of an HTTP response in the context of request-to-response mappings. This class allows customization of the HTTP status code and headers and provides a mechanism for building concrete response definitions.

Author

Konstantin Pavlov

Type Parameters

P

The type of the request body, used to type the CapturedRequest available during building.

T

The type of the response data, which is returned to the client.

Inheritors

Constructors

Link copied to clipboard
constructor(delay: Duration = Duration.ZERO)

Types

Link copied to clipboard
inner class HeadersConfigurer

Provides the headers { } lambda and headers += pair-shorthand syntax for configuring response headers within a AbstractResponseDefinitionBuilder.

Properties

Link copied to clipboard
Link copied to clipboard

Entry point for header configuration. Supports two syntaxes:

Link copied to clipboard

The HTTP status code of the response.

Link copied to clipboard

The HTTP status code to be associated with the response.

Functions

Link copied to clipboard
fun addHeader(name: String, value: String)

Adds a single response header.