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

Boris Yordanov

12/22/2021, 10:10 AM
Hey guys, I've stumbled upon an interesting problem with ktor in a multiplatform mobile project: We have a request with parameter that can be both in cyrilic and latin. Executing the request in iOS results in the following:
Copy code
find?query=Dru
responds fine.
Copy code
find?query=%D0%94%D1%80%D1%8
which is equal to
Copy code
find?query=ДРУ
gives an empty json response in ktor, while executing the request with the same encoded query param gives a populated response in postman/swagger This is the full log from ktor.
Copy code
HttpClient: RESPONSE: 200 OK
HttpClient: METHOD: HttpMethod(value=GET)
HttpClient: FROM: **********/find?query=%D0%94%D1%80%D1%83&maxResults=20
HttpClient: COMMON HEADERS
HttpClient: -> Content-Length: 2
HttpClient: -> Content-Type: application/json; charset=utf-8
HttpClient: -> Date: Tue, 21 Dec 2021 13:22:23 GMT
HttpClient: -> Server: Microsoft-IIS/8.0
HttpClient: -> X-Powered-By: <http://ASP.NET|ASP.NET>
HttpClient: -> api-supported-versions: 1.0
HttpClient: BODY Content-Type: application/json; charset=utf-8
HttpClient: BODY START
HttpClient: []
HttpClient: BODY END
Any idea what could be happening? We are using ktor 1.6.3
a

Aleksei Tirman [JB]

12/22/2021, 10:21 AM
Please compare the actual requests made by Ktor and postman/swagger with the Wireshark or similar software to understand what goes wrong with Ktor.