what is the correct way to render a “HTTP 204 No C...
# ktor
p
what is the correct way to render a “HTTP 204 No Content” response in ktor? The problem seems so easy but I can’t find any non-trivial solution to it.
p
wow, I was always looking for something like content = NoContent but this is just nice
thanks @Matteo Mirk
m
you’re welcome! Just take a look at Ktor docs, they cover almost all of its API with examples
👍 1
p
I did but somehow I managed to NOT find it 🙂
m
the code I showed you just sets the response status and the body remains empty, provided that’s the only or last statement in your route handler that manipulates the response
p
exactly what I needs … thanks a lot
m
I did but somehow I managed to NOT find it
don’t worry, some things are a little hidden in the docs or mentioned in just a sentence, which is a pity
p
still ktor rocks heavy!! we did not use spring boot in the current company’s project (and they all use it despite the bloat 🙂 ) and I can’t tell you how happy we are.
m
I know! I started using Ktor just after learning kotlin basics and really love it! Even if Kotlin is being adopted in my company, I cannot use it currently and I’m stuck working with legacy Spring boot apps. +1 for choosing ktor over Spring! 👍
p
it’s the fresh breeze we all were waiting for after years of bloated containers, annotation driven code, bytecode instrumentation und bloated libraries 🙂
🎊 1