Calls
When handling routes, or directly intercepting the pipeline, you get a context with an ApplicationCall.
Installing an interceptor into the pipeline is the primary method to alter the processing of an ApplicationCall
. Nearly all Ktor features are interceptors that perform various operations in different phases of the application call processing.
The code above installs an interceptor into the Call
phase of an processing and responds with plain text when the request is asking for a root page.
Most functions available on ApplicationCall
(such as respondText
above) are functions, indicating that they can potentially execute asynchronously.
See advanced topic for more information on the mechanics of processing ApplicationCall
s.