Drand Http Api
class DrandHttpApi(baseUrl: String = "https://api.drand.sh", httpClient: HttpClient = createDefaultHttpClient()) : DrandApi
HTTP implementation of the drand API using Ktor client.
Provides access to drand's v2 HTTP API with proper error handling and JSON serialization.
Example:
val api = DrandHttpApi()
val beacon = api.beacons.latest("default").getOrThrow()
api.close()Content copied to clipboard
Parameters
base Url
Base URL for the drand API (default: https://api.drand.sh)
http Client
Custom HttpClient instance (optional, for testing/customization)
Constructors
Link copied to clipboard
constructor(baseUrl: String = "https://api.drand.sh", httpClient: HttpClient = createDefaultHttpClient())