https://kotlinlang.org logo
#getting-started
Title
# getting-started
t

Travis Griggs

11/08/2023, 11:27 PM
I used okhttp3 in a previous project for http requests. My needs are pretty simple (I think). Infrequent gets and posts with json bodies. Need to build/deconstruct URIs. Ok is a Java library, I'm curious if there are any recommendations for something current, lightweight, in Kotlin. I don't need caching either (in fact, I often have to go out of my way to disable it)
👌 1
h

hho

11/08/2023, 11:40 PM
There has been a thread about okhttp 5.0 going multiplatform: https://kotlinlang.slack.com/archives/C5HT9AL7Q/p1699103553510069 (check out #squarelibraries for more info) Until that's ready, the ktor http client is probably the multiplatform way to go.
e

ephemient

11/08/2023, 11:40 PM
I don't think there are any java sources left (aside from tests and samples)
nothing wrong with that anyway, as long as you'e on the JVM or something similar
c

Casey Brooks

11/16/2023, 3:41 PM
ktor by JB is the typical recommendation for a basic KMP HTTP client. There’s also Ktorfit which is a 3rd-party library that works similar to Retrofit, wrapping the Ktor client and providing a more type-safe API on top of it