import io.ktor.client.* import io.ktor.client.features.json.* import io.ktor.client.request.* val httpClient = HttpClient { install(JsonFeature) { serializer = JacksonSerializer() } } suspend fun main() { val postA = httpClient.get>("https://jsonplaceholder.typicode.com/posts").first() val postB = httpClient.getFirst("https://jsonplaceholder.typicode.com/posts") } suspend inline fun HttpClient.getFirst(url: String) = get>(url).first() data class Post( val userId: Int, val id: Int, val title: String, val body: String )