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

klausner

04/06/2021, 5:46 PM
There is an error in 1.5.2 version changelog. This follow issue was not included to released version
Copy code
Add an option to disable URL Encoding
<https://youtrack.jetbrains.com/issue/KTOR-553>
This issue was imported from GitHub issue: <https://github.com/ktorio/ktor/issues/1351>

Subsystem ktor-client, ktor-http/common

Is your feature request related to a problem? Please describe. ktor-client cannot be used for URLs which are not supported by the URL Encoding format.

I failed to replace an HTTP client with ktor-client just because we needed to call a URL like /api?k1=v1;k1=v2 (non-encoded ; instead of %3B). As far as I checked, there's no way to bypass URL Encoding in ktor-client.

In other libraries, typically we can set parameters just like a simple Map<String, List<String>>. I agree that it's better to always use a sanitized request object, but it would be too strict not to have an option to disable encoding.

Describe the solution you'd like I opened a PR to add an option to bypass the URL Encoding when building a URL.

Motivation to include to ktor I believe that users of ktor-client shouldn't be blocked by the implementation of a server URL because they might not have control over it.

(Please let me know if there's an option to resolve the above problem.)
r

Rustam Siniukov

04/06/2021, 8:02 PM
thanks for noticing. the ticket had wrong
target release
set
👍🏽 1
3 Views