Henrik Johansson
04/18/2023, 6:59 AMCallId
for and I would like avoid setting it everywhere. I have tried extending it like:
suspend inline fun HttpClient.get(url: String): HttpResponse {
return get(url) {
headers {
append(HttpHeaders.XRequestId, MDC.get("CallId"))
}
}
}
But that does not allow for setting other headers that are needed in only a few places.
Is there a way to always set a particular header like this one which is per request but still allow for more customization of the headers or other properties in specific call sites?Aleksei Tirman [JB]
04/18/2023, 8:59 AMHenrik Johansson
04/18/2023, 11:44 AM