Projets
Voir sur GitHub
rybalkinsd/kohttp
À propos
Client HTTP avec une DSL Kotlin
Outils de développementProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalIntroduction
Kotlin DSL http client
Features
🔹 Developers Experience-driven library without verbosity.
🔹 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.
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
- 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
Installation
Gradle
Kotlin DSL:
implementation(group = "io.github.rybalkinsd", name = "kohttp", version = "0.12.0")
Groovy DSL:
implementation 'io.github.rybalkinsd:kohttp:0.12.0'
Maven:
<dependency>
<groupId>io.github.rybalkinsd</groupId>
<artifactId>kohttp</artifactId>
<version>0.12.0</version>
</dependency>
Table of contents
Explorer des projets similaires
Chargement…