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

pyryjook

07/03/2019, 7:45 PM
Hi! I’ve been fiddling around with Ktor and K/N on MacOS. I got other suspending functions which do work in the same app(called the same way as the following function), but this suspended function just hangs forever:
Copy code
suspend fun getContent(): String {
    val client = HttpClient()
    return client.get<String>("<http://www.google.com>")
}
Any ideas on what might cause it? I came across with the following similar issues, but I was not able to fix the issue of mine based on how the these issues had been solved: - https://stackoverflow.com/q/56347516/1538877 - https://github.com/ktorio/ktor/issues/678 All the help is appreciated, thanks in advance!
s

Sergioedcigreja

07/03/2019, 8:43 PM
Does iOS allow requests to http urls? cant remember.. but I remember an issue about a url that used http instead of https and we had to find an alternative
p

pyryjook

07/04/2019, 5:33 AM
Thanks, I’ll give it a try! But I run it on MacOS and there Ktor uses the Curl engine.
I can finally confirm that changing the protocol did not help with this issue.
Anyone have any suggestions or ideas what might cause request to hang ^^?
s

Sergioedcigreja

07/12/2019, 12:44 PM
have you tried it with request?
client.request { method = HttpMethod.Get
p

pyryjook

07/14/2019, 2:09 PM
I just tried, no changes in the behaviour
How the HttpClient looks on CLion, might be related. I do not know why it shows up red there, but no errors what so ever. 🤷🏻‍♂️
Any ideas on why this would have happened?
g

gildor

07/29/2019, 9:10 AM
This is known issue, everything is fine, it’s just confusing syntax highlighting
p

pyryjook

07/29/2019, 11:25 AM
Yeah, I figured that it might be the case for the highlighting part. Thanks for confirming.
Other than that, the request is still hanging. So the original problem persists 😞