Kotlin DSL http client
🔹 Developers Experinece-driven library without verbosity.
🔹 Providing a native way to use http client in Kotlin.
🔹 HTTP GET
/POST
/PUT
/HEAD
/DELETE
/PATCH
requests.
🔹 Asynchronous and blocking requests.
🔹 Upload files.
🔹 Logging - easily dump your http requests or convert them to cURL commands.
🔹 Minimal footprint.
val response = "https://my-host.com/users?admin=true".httpGet()
// use integration with your favorite serialization library
val usersData = users.toJson()
val pushNotifications: List<Deferred<Response>> = usersData.map {
httpPostAsync {
url("https://my-host.com/friends/push")
param {
"userId" to it[id]
"eventType" to NewFriend
}
header {
"locale" to "en_EN"
cookie {
"user_session" to "toFycNV"
"authToken" to "d2dwa6011w96c93ct3e3493d4a1b5c8751563217409"
}
}
}
}
- Kotlin weekly mentioned us
- Android weekly (CN) mentioned us
- Kotlin http client. Making kohttp 0.11.0 - medium post
- Write your Android network as Kotlin DSL - medium post
- Upload files to Google Drive with Kotlin - medium post
- Production Kotlin DSL (RU + subtitles) - Kotlin/Everywhere talk, YouTube
Kotlin DSL:
implementation(group = "io.github.rybalkinsd", name = "kohttp", version = "0.11.0")
Groovy DSL:
implementation 'io.github.rybalkinsd:kohttp:0.11.0'
<dependency>
<groupId>io.github.rybalkinsd</groupId>
<artifactId>kohttp</artifactId>
<version>0.11.0</version>
</dependency>