what’s the canonical way to create a URL string li...
# ktor
p
what’s the canonical way to create a URL string literal with encoded parameters?
i’ve been doing this which doesn’t feel like the best way:
Copy code
handleRequest(HttpMethod.Get, "/login?${listOf("redirectUrl" to clientRedirectURL).formUrlEncode()}")
a
Copy code
val builder = URLBuilder().apply {
    encodedPath = "/login"
    parameters.append("redirectUrl", "<https://www.google.com/>")
}
val url = builder.build()
println(url.fullPath)
👍 1