I'm creating universal application and I need to use Keep-Alive connection header for my requests. I have the code
using (var client = new System.Net.Http.HttpClient())
{
client.DefaultRequestHeaders.Add("connection", "Keep-Alive");
var str = await client.GetStringAsync(uri);
return str;
}
but I catch exception The header Connection has an empty value. Please somebody show me where is my mistake and how I can set Connection header to Keep-Alive
I've added screenshot from Wireshark where you can see Connection header value by default (if remove client.DefaultRequestHeaders.Add("connection", "Keep-Alive");)
Windows.Web.Http.HttpClient
requests areKeepp-Alive
by default.