Hello! is there anyone aware about KMP typesafe re...
# ktor
m
Hello! is there anyone aware about KMP typesafe resources client usage for iOS? Compilation for Android app works perfect but calling the client with a resource on iOS shows a
message	ObjHeader *	Invalid url: {totally valid url that works in browser}
actually I can share the url, its not a secret xD: https://www.airalo.com/api/v2/countries/germany
a
Can you share the iOS-side code snippet?
🙏🏻 1
m
yes let me prepare a minimum reproducible code snipet (there is some boilerplate to get rid on for simplicity)
sorry for the delay, here are the Snippets to reproduce the issue: https://gist.github.com/Atternatt/51984d6192deb3662de9259b675e6577
a
The problem is that the value for the
host
method from the DefaultRequest configuration is incorrect. It must only contain domain and the port. To fix the problem use the following configuration:
Copy code
defaultRequest {
    url {
        url("<https://www.airalo.com/api/>")
        header("Content-Type", "application/json")
        header("Accept-Language", "en")
    }
}
🙏🏻 1
m
ohh, but just a side note. works for Android but not for iOS. Thank you for the tip! let me test it and confirm 🤘🏻