Is specifying a full url (to override base url fro...
# ktor
u
Is specifying a full url (to override base url from default request) broken?
Copy code
val ktorClient = HttpClient {
    install(DefaultRequest) {
        url("<http://10.0.2.2:8080/>")
    }
}
ktorClient
    .get("<https://blog.hootsuite.com/wp-content/uploads/2020/02/Image-copyright.png>")
    .bodyAsText()
yields
java.net.UnknownHostException: Unable to resolve host "<http://blog.hootsuite.com|blog.hootsuite.com>": No address associated with hostname
according to docs it should work https://api.ktor.io/ktor-client/ktor-client-core/io.ktor.client.plugins/-default-r[…]DY2*_ga_9J976DJZ68*MTcxOTMyMTUyOC4yMi4wLjE3MTkzMjE1MjguNjAuMC4w
client.get("<https://some.url>")
// ktor = "2.3.12"
a
I have no problem running your code except for the
bodyAsText
call.
u
I don't know what I did, but now it works 😄 Probably just a incremental compilation issue or something.