First, we need to create a Ktor client to make network requests similarly to the retrofit builder. We use Ktor’s HTTP client and pass the engine in the constructor (in this case, it’s CIO). Then we have to install a specific feature and optionally configure it.
Read moreWhat is the difference between retrofit and OkHttp?
Retrofit vs. OkHttp The reason is simple: OkHttp is a pure HTTP/SPDY client responsible for any low-level network operation, caching, request and response manipulation, and many more. In contrast, Retrofit is a high-level REST abstraction build on top of OkHttp .
Read moreWhat is KTOR Android?
Ktor is an asynchronous open source framework for creating microservices and web applications . It was developed with Kotlin by Jetbrains. It’s easy to install and use, It’s extensible if you want to add a step to the execution pipeline.
Read more