Ktor 1.5 is released. This is a web framework created by the Kotlin team that can be used to create asynchronous, high-performance and lightweight web servers, and use Kotlin's idiomatic APIs to build non-blocking multi-platform web clients.
1.5.0 is the third and final version of this year. A series of new features have been added in this update, including:
- The new development model: The new version introduces a new development model , the mode can be achieved by simple configuration or logo auto-reload and extended debug information, make it easier to switch production setting. You can activate this function
application.conf
with thedevelopment=true
active one. - Support for Java HTTP client: Java 11 introduces an HTTP client based on response flow . Now, the Ktor client also supports this feature for JVM.
- Support for sending cookies through HttpRequestBuilder:
cookies
A new method named HttpRequestBuilder has been added , which can easily send cookies. - Support for pre-compressed files: Add
preCompressed
function to send compressed files and prevent Ktor from trying to compress the content further. - Support custom headers in CORS.
- Introduces support for WebSocket and deflate extension of
- Supports sealed and nested classes in server sessions.
- OkHttp WebSocket creation rewrite.
- Correct exception handling: Ktor can now handle unexpected exceptions correctly. If an exception occurs in the pipeline, it will be propagated to the host and returned as a 500 Internal Server Error along with the actual exception object. This can better handle exceptions in the application itself, and no longer need to configure the status page for a specific status code.
Detailed change log: https://blog.jetbrains.com/ktor/2020/12/22/ktor-1-5-0-released/