MockRequestHandleScope
Scope for MockRequestHandler.
Constructors
Extensions
Link copied to clipboard
fun MockRequestHandleScope.respond(content: String, status: HttpStatusCode = HttpStatusCode.OK, headers: Headers = headersOf()): HttpResponseData
fun MockRequestHandleScope.respond(content: ByteArray, status: HttpStatusCode = HttpStatusCode.OK, headers: Headers = headersOf()): HttpResponseData
fun MockRequestHandleScope.respond(content: ByteReadChannel, status: HttpStatusCode = HttpStatusCode.OK, headers: Headers = headersOf()): HttpResponseData
Send response with specified ByteReadChannel, status and headers.
Link copied to clipboard
Send HttpStatusCode.BadRequest response.
Link copied to clipboard
fun MockRequestHandleScope.respondError(status: HttpStatusCode, content: String = status.description, headers: Headers = headersOf()): HttpResponseData
Send error response.
Link copied to clipboard
Send ok response.
Link copied to clipboard
Respond redirect with location in Location header.