+1 for me, from what I've gathered so far you could use
call.receiveParameters()
to get what is basically a
Map<String, List<String>>
to work with. This doesn't automatically parse into models like the JSON converters.
To use the syntax of
call.receive<MyDataModel>()
with
x-www-form-urlencoded
we need to use the
ContentNegotiation
feature and write our own converter to do the mapping:
install(ContentNegotiation) {
register(ContentType.Application.FormUrlEncoded, FormUrlEncodedConverterThatNeedsWriting())
}
I'm knew to Kotlin so I haven't managed to write a converter to handle form data in the same way as something like Ruby on Rails does using
[ ]
as delimiters.
I've made this gist from the JacksonConverterTest incase someone is able to help:
https://gist.github.com/createdbypete/ac57c6b59133b184799fadbf32b4b93a