Package io.ktor.client.engine.mock
Types
class MockEngine : HttpClientEngineBase HttpClientEngine for writing tests without network. |
|
class MockEngineConfig : HttpClientEngineConfig |
|
class MockRequestHandleScope Scope for MockRequestHandler. |
Type Aliases
typealias MockRequestHandler = suspend MockRequestHandleScope.(request: HttpRequestData) -> HttpResponseData Single HttpClientCall to HttpResponse mapper. |
Functions
fun MockRequestHandleScope.respond( Send response with specified string content, status and headers. fun MockRequestHandleScope.respond( Send response with specified bytes content, status and headers. fun MockRequestHandleScope.respond( Send response with specified ByteReadChannel, status and headers. |
|
fun MockRequestHandleScope.respondBadRequest(): HttpResponseData Send HttpStatusCode.BadRequest response. |
|
fun MockRequestHandleScope.respondError( Send error response. |
|
fun MockRequestHandleScope.respondOk( Send ok response. |
|
fun MockRequestHandleScope.respondRedirect( Respond redirect with location in Location header. |
|
suspend fun OutgoingContent.toByteArray(): ByteArray |
|
suspend fun OutgoingContent.toByteReadPacket(): ByteReadPacket |