while using ktor-client I am facing a problem wher...
# ktor
n
while using ktor-client I am facing a problem where, I used to configure the host & protocal in default request this way
Copy code
val client = HttpClient(CIO) {
    defaultRequest {
        url {
            protocol = URLProtocol.HTTPS
            host = "ktor.io"
            path("docs/")
            parameters.append("token", "abc123")
        }
        header("X-Custom-Header", "Hello")
    }
}
but now I have to configure it in each block this way
Copy code
client.get {
    url {
        protocol = URLProtocol.HTTPS
        host = "ktor.io"
        path("docs/welcome.html")
    }
}
if i don't configure it separately , then the http method which goes to request become 1, instead of 2, the default request method used to work, and is still working for a different env , but don't know what's wrong with my current env ?
k
what is it 1 and 2 you are talking about?
n
http 1.1 and http2
k
You are using
CIO
engine. And it doesn't support HTTP 2.