https://kotlinlang.org logo
#ktor
Title
# ktor
b

Berkay Özkan

03/01/2023, 7:39 AM
Hi, when sending request like
Copy code
val response = client.get("<http://some-endpoint.com|some-endpoint.com>") {
            parameter("name", "aaa")
            parameter("name", "bbb")
            parameter("surname", "ccc")
        }
generated url becomes =
<http://some-endpoint.com?name=aaa&name=bbb&surname=ccc|some-endpoint.com?name=aaa&name=bbb&surname=ccc>
but i want
<http://some-endpoint.com?name=aaa,bbb&surname=ccc|some-endpoint.com?name=aaa,bbb&surname=ccc>
how can i achieve it
a

Aleksei Tirman [JB]

03/01/2023, 4:53 PM
Copy code
val response = client.get("<http://httpbin.org/get>") {
    parameter("name", listOf("aaa", "bbb").joinToString(separator = ","))
    parameter("surname", "ccc")
}
5 Views