Hey all, i am using ktor-client with basic auth. d...
# ktor
a
Hey all, i am using ktor-client with basic auth. depending on the situation, my backend needs to call the other rest endpoint with different users. is it possible to reuse the same http client and only provide the basic auth credentials on a call-by-call basis, instead of configuring it just once when creating the http client?
d
Haven't tested it but according to the documentation you should be able to use sth like.
Copy code
client.get("<https://ktor.io>") {
    headers {
        basicAuth("username", "password")
    }
}
­čĹŹ 1
a
awesome. I searched the docs but didn't find it. Where did you find this example?