Ktor for Mobile Developers: Is it Easy to Learn Server Side Coding? Part-2
As you already check out my previous post about What is Ktor Framework? and How to get started?. In case of you didn’t please read this Ktor for Mobile Developers: Is it Easy to Learn Server Side Coding? Part-1 . So lets get deep dive into Ktor Framework and start solve some real world complex problem. I am assuming you already created basic structure project. In this section we are going to learn how to send response or accept the request in Json format. For Json parsing w e are using Jackson library. To install Json library add gradle dependency in ur build.gradle file. implementation "io.ktor:ktor-jackson:$ktor_version" Now install Jackson as ContentNegotiation library in Application.module . install (ContentNegotiation) { jackson { enable(SerializationFeature. INDENT_OUTPUT ) } } In next step we are going to create Data Model class that will convert into Json structure and send it as response. @JsonIgnoreProperties(ignoreUnknown = true) data class U