How can i add header to all my requests using ktor...
# ktor
a
How can i add header to all my requests using ktor client? I am adding the header as per docs:
Copy code
HttpClient {
        defaultRequest {
            header("my_header", "random_text")
        }
    }
        .post(url) {
            println("--- headers==")
            println(headers) // <-- empty??
        }
But headers is empty. This is on v 2.3.9 EDIT: The variable says empty but the header are included. I logged the request and it's there. All is good 👍
308 Views