Hi! I’ve been fiddling around with Ktor and K/N o...
# ktor
p
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
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
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
have you tried it with request?
client.request { method = HttpMethod.Get
p
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
This is known issue, everything is fine, it’s just confusing syntax highlighting
p
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 😞