MockzillaHttpResponse

@Serializable
data class MockzillaHttpResponse(val statusCode: HttpStatusCode = HttpStatusCode.OK, val headers: Map<String, String> = emptyMap(), val body: String = "")

An HTTP response returned by a mock endpoint handler. Returned from EndpointConfiguration.Builder.setDefaultHandler and EndpointConfiguration.Builder.setErrorHandler lambdas.

Constructors

Link copied to clipboard
constructor(statusCode: HttpStatusCode = HttpStatusCode.OK, headers: Map<String, String> = emptyMap(), body: String = "")

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The response body as a string.

Link copied to clipboard

HTTP response headers.

Link copied to clipboard
@Serializable(with = HttpStatusCodeSerializer::class)
val statusCode: HttpStatusCode

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

Functions

Link copied to clipboard