while using ktor-client I am facing a problem where, I used to configure the host & protocal in default request this way
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
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 ?