Hey guys, I'm considering using ktor for rest clie...
# android
p
Hey guys, I'm considering using ktor for rest client, instead of Retrofit. Do you mind sharing any opinions on that topic? I'm also interested in unit testing.
m
I use it in my projects. I like it. Depends on what you prefer. Nothing wrong with either one
c
I guess it's nice that ktor is KMM compatible.
c
I think the only bad part is that Ktor isn't very well documented. It's a really nice tool though.
p
It shouldn't be that bad, if you're still using it I guess 🙂
Did you try to unit test ktor? Judging from documentation, testing seems a bit more practical to me maybe
j
They're both wrappers on top of OkHttp
They're both testable and support similar features. ktor supports MPP and has nicer api imo. I use ktor in new projects. For simple stuff I just use okhttp directly
I haven't had any issues w/ the ktor client documentation. Its pretty simple
c
Yep I'm using basic unit tests (as shown in the docs). It's easy to use and works well, but I haven't used unit tests in other frameworks so I can't compare it to anything.
j
retrofit just exposes api as an interface so you just make a fake or mock
x
ktor doesn’t only just wrap okhttp - there are multiple engines that ktor ‘wraps’ around