addamsson
04/22/2020, 11:54 AMEvan R.
04/23/2020, 12:10 PMEvan R.
04/23/2020, 12:12 PMEvan R.
04/23/2020, 12:29 PMContentType.Application.FormUrlEncoded
you’ll get the 415 backaddamsson
04/24/2020, 11:18 AMaddamsson
04/24/2020, 11:18 AMserialization { json() }
Evan R.
04/24/2020, 1:12 PMcall.respondText()
like so:
accept(ContentType.Application.FormUrlEncoded) {
route("/api") {
get("/test") {
println("Got message")
// Do stuff
val response = listOf("hello" to "world").formUrlEncode()
call.respondText(response, ContentType.Application.FormUrlEncoded)
}
}
}
Evan R.
04/24/2020, 1:12 PMEvan R.
04/24/2020, 1:13 PMaddamsson
04/25/2020, 9:41 AMaddamsson
04/25/2020, 9:42 AMaddamsson
04/25/2020, 9:42 AMaddamsson
04/25/2020, 9:42 AMEvan R.
04/29/2020, 1:15 PMParameters
object, you can do so via:
call.receive<String>().parseUrlEncodedParameters()
Evan R.
04/29/2020, 1:16 PMaccept()
block you have is fine if you want to just have those endpoints receive form data. The effect will just be that if you try to hit it with a different content type it will respond with a 404 not foundaddamsson
05/01/2020, 12:18 PM