How to set HttpHeader on individual request using HttpClient
I have an HttpClient that is shared across multiple threads: public static class Connection { public static HttpClient Client { get; } static Connection() { Client = new HttpClient { BaseAddress = new Uri(Config.APIUri) }; Client.DefaultRequestHeaders.Add("Connection", "Keep-Alive"); Client.DefaultRequestHeaders.Add("Keep-Alive", "timeout=600"); Client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); } } It has some default headers I put onto each request. However, when I use it, I want to add on a header for just that request: var client = Connection