kohttp alternatives and similar libraries
Based on the "Http Clients" category.
Alternatively, view kohttp alternatives based on common mentions on social networks and blogs.
-
httpmocker
HttpMocker is a simple HTTP mocking library written in Kotlin to quickly and easily handle offline modes in your apps -
networkinkt
Multiplatform coroutine-based HTTP client wrapper for Kotlin
Appwrite - The Open Source Firebase alternative introduces iOS support
Do you think we are missing an alternative of kohttp or a related project?
Popular Comparisons
README
Introduction
Kotlin DSL http client
Features
๐น Developers Experience-driven library without verbosity.
๐น Native way to use http client in Kotlin.
๐น HTTP [GET
](gitbook/core/synchronous-calls/get.md)/[POST
](gitbook/core/synchronous-calls/post.md)/[PUT
](gitbook/core/synchronous-calls/put.md)/[HEAD
](gitbook/core/synchronous-calls/head.md)/[DELETE
](gitbook/core/synchronous-calls/delete.md)/[PATCH
](gitbook/core/synchronous-calls/patch.md) requests.
๐น [Asynchronous](gitbook/core/asynchronous-calls/) and [blocking](gitbook/core/synchronous-calls/) requests.
๐น [Upload files](gitbook/core/synchronous-calls/upload-files.md).
๐น [Logging](gitbook/core/interceptors.md#logging-interceptor-a-request-logging-interceptor) - 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
- [Synchronous calls](gitbook/core/synchronous-calls/)
- [GET](gitbook/core/synchronous-calls/get.md)
- [POST](gitbook/core/synchronous-calls/post.md)
- [PUT](gitbook/core/synchronous-calls/put.md)
- [HEAD](gitbook/core/synchronous-calls/head.md)
- [DELETE](gitbook/core/synchronous-calls/delete.md)
- [PATCH](gitbook/core/synchronous-calls/patch.md)
- [Upload files](gitbook/core/synchronous-calls/upload-files.md)
- [Generic requests](gitbook/core/synchronous-calls/generic-requests.md)
- [Asynchronous calls](gitbook/core/asynchronous-calls/)
- [async GET](gitbook/core/asynchronous-calls/async-get.md)
- [async POST](gitbook/core/asynchronous-calls/async-post.md)
- [async PUT](gitbook/core/asynchronous-calls/async-put.md)
- [async HEAD](gitbook/core/asynchronous-calls/async-head.md)
- [async DELETE](gitbook/core/asynchronous-calls/async-delete.md)
- [async PATCH](gitbook/core/asynchronous-calls/async-patch.md)
- [async Upload files](gitbook/core/asynchronous-calls/async-upload-files.md)
- [async Generic requests](gitbook/core/asynchronous-calls/generic-requests.md)
- [Response usage](gitbook/core/response-usage.md)
- [Interceptors](gitbook/core/interceptors.md)
- [Customisation](gitbook/core/customisation.md)
- [Experimental features](gitbook/core/experimental-features.md)
- [Changelog](gitbook/history/changelog.md)