Stylianos Gakis
07/02/2021, 2:40 PM@Location("/login")
data class PostLogin(val username: String, val password: String)
But I want the username
and the password
to be part of the body of the post request instead of the Params.
Is that something that is possible, or must I do call.receive
like I would when I wasn’t using the Locations plugin?nschulzke
07/02/2021, 3:33 PMStylianos Gakis
07/02/2021, 3:39 PM<http://Route.post|Route.post>
method that allows you to pass a reified type and it does the call.receive()
for you allowing me to write a route that looks something like this:
@Serializable
data class Login(val username: String, val password: String)
post<Login>("login") { login: Login ->
val response = authController.login(
Username(login.username), Password(login.password)
)
call.respondWith(response)
}
I guess that’s too bad that I can’t use the Locations plugin, but if it can’t do that for me, I don’t see a reason for me to use it other than a prettier way to define the routes.nschulzke
07/02/2021, 3:44 PMStylianos Gakis
07/02/2021, 3:45 PMDominaezzz
07/02/2021, 7:48 PM