I am using Ktor on the client side, using ```Param...
# ktor
t
I am using Ktor on the client side, using
Copy code
Parameters.apply { append(key, value) }
issue is that it is encoding spaces as ‘+’, whereas I need then as ‘%20’. Anybody know if there is a way to adjust this? Or perhaps (like Retrofit) there could be an ‘appendEncoded()’ type call? Thank you!
Debugging the calls, I see this code in HttpUrlEncoded is being used:
Copy code
fun List<Pair<String, String?>>.formUrlEncodeTo(out: Appendable) {
    joinTo(
        out, "&"
    ) {
        val key = it.first.encodeURLParameter(spaceToPlus = true)
        if (it.second == null) {
            key
        }
        else {
            val value = it.second.toString().encodeURLParameter(spaceToPlus = true)
            "$key=$value"
        }
    }
}
Seems kind of rude to assume we want spaces as pluses. The encodeURLParameter even defaults to false, but this code is overriding that.