🔹 Developers Experience-driven library without verbosity.
🔹 Native way to use http client in Kotlin.
🔹 Minimal footprint.
Quick start
// Use String or URL extensions send simple request
val response = "https://my-host.com/users?admin=true".httpGet()
// Parse response with your favorite library
val users = response.toJson()
// Use sync or async methods to send your requests
// Configure method params, headers, cookies and body in a concise way
val notifications: List<Deferred<Response>> = users.forEach { user ->
httpPostAsync {
url("https://my-host.com/friends/push")
param {
"userId" to user[id]
"eventType" to NewFriend
}
header {
"locale" to "en_EN"
cookie {
"user_session" to "toFycNV"
"authToken" to "d2dwa6011w96c93ct3e3493d4a1b5c8751563217409"
}
}
}
}
Samples
About kohttp
Installation
Gradle
Kotlin DSL:
implementation(group = "io.github.rybalkinsd", name = "kohttp", version = "0.12.0")