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