#ktor Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
Kotlin Ktor Server — Middleware (Plugins)
Plugins wrap every request — logging, CORS, auth, rate limiting. Install with `install(Plugin) { config }` at the application level.
Kotlin Ktor Client — GET Request
Ktor is JetBrains' Kotlin-first HTTP client. Multiplatform (JVM, JS, Native). Coroutine-native — every call is a suspend function.
Kotlin Ktor Server — Hello World
Ktor lets you stand up an HTTP server in a few lines. Pick an engine (Netty / Jetty / CIO), declare routes, run. Coroutine-native end to end.
Kotlin Ktor Client — POST JSON with Serialization
Combine Ktor + kotlinx.serialization: register the JSON plugin, declare `@Serializable` data classes, the client (de)serializes automatically.
Kotlin Ktor Server — JSON API with kotlinx.serialization
Install `ContentNegotiation` + `Json` plugin and you get typed (de)serialization for every route. Decode request bodies into data classes; respond with data classes.