KtorHttpClient

class KtorHttpClient(ktorClient: HttpClient) : HttpClient

Ktor-based HTTP client implementation using the CIO engine.

This class implements the HttpClient interface using Ktor's HTTP client library with the CIO (Coroutine-based I/O) engine. It provides a bridge between the SDK's generic HttpClient interface and Ktor's powerful HTTP client capabilities.

The CIO engine is a pure Kotlin implementation that:

  • Uses Kotlin Coroutines for asynchronous operations

  • Has minimal external dependencies

  • Is lightweight and efficient

  • Works across all platforms (JVM, Android, Native)

See also

Constructors

Link copied to clipboard
constructor(ktorClient: HttpClient)

Functions

Link copied to clipboard
open override fun close()

Closes the underlying Ktor HTTP client and releases all resources.

Link copied to clipboard
open override fun request(): KtorHttpRequest

Creates a new KtorHttpRequest instance.

open suspend override fun request(request: HttpRequest): KtorHttpResponse

Sends an HTTP request and returns the response.

open suspend override fun request(requestBuilder: HttpRequest.() -> Unit): KtorHttpResponse

Sends an HTTP request built with a builder lambda and returns the response.