mmaillot
11/25/2020, 9:35 PMcall.respond(HttpStatusCode.NoContent, Unit)
I have {}
in the content.carrot
11/25/2020, 11:58 PMMilan Hruban
11/26/2020, 8:31 AMApplicationCall.respond(status: HttpStatusCode, message: Any)
or
ApplicationCall.respond(message: Any)
if you send only HttpStatusCode, the second method will be used and the status will be serialized as response contentmmaillot
11/26/2020, 9:10 AMrespond
method doesn’t exist with only the HTTP code as parameter.Matteo Mirk
11/26/2020, 9:15 AMcall.response.status(HttpStatusCode.NoContent)
that’s it, you just access the response object and set values which will be immediately sent to the client.
https://ktor.io/docs/responses.htmlcarrot
11/26/2020, 10:05 AMcall.respond(HttpStatusCode.NoContent)
directly - there'll be a feature somewhere checking if message
has a type of HttpStatusCode
and mutating the response. I'll have a dig later 🙂