HttpClient
interface HttpClient
Interface for HTTP client implementations.
This interface defines the contract for making HTTP requests and receiving responses. It provides an abstraction that can be implemented using different underlying HTTP client libraries (Ktor, OkHttp, Apache HttpClient, etc.) while maintaining a consistent API across the SDK.
Implementations
The SDK provides a default implementation using Ktor with CIO engine: You can also create custom implementations for specific requirements:
class CustomHttpClient : HttpClient {
override fun request(): HttpRequest = CustomHttpRequest()
override suspend fun request(request: HttpRequest): HttpResponse { ... }
override suspend fun request(requestBuilder: HttpRequest.() -> Unit): HttpResponse { ... }
override fun close() { ... }
}Content copied to clipboard