Response Definition Builder
open class ResponseDefinitionBuilder<P : Any, T : Any>(val request: CapturedRequest<P>, var contentType: <Error class: unknown class>? = null, var body: T? = null, httpStatus: <Error class: unknown class> = HttpStatusCode.OK, headers: MutableList<<Error class: unknown class><String, String>> = mutableListOf()) : AbstractResponseDefinitionBuilder<P, T>
Builder for constructing a definition of an HTTP response with configurable attributes.
Parameters
P
The type of the request body.
T
The type of the response body.
http Status
The HTTP status code of the response. Defaults to HttpStatusCode.OK
.
headers
A mutable list of additional custom headers for the response.
Inherits functionality from AbstractResponseDefinitionBuilder to allow additional header manipulations and provides a concrete implementation of the response building process.
Constructors
Link copied to clipboard
constructor(request: CapturedRequest<P>, contentType: <Error class: unknown class>? = null, body: T? = null, httpStatus: <Error class: unknown class> = HttpStatusCode.OK, headers: MutableList<<Error class: unknown class><String, String>> = mutableListOf())
Properties
Link copied to clipboard
Optional MIME type of the response. Defaults to ContentType.Application.Json
if not specified.
Link copied to clipboard
A mutable list of header key-value pairs to be included in the response.
Link copied to clipboard
The HTTP status code to be associated with the response.
Link copied to clipboard