Reputation: 7
Could you please let me know the difference between HttpClient object Timeout property vs the DefaultRequestHeaders "Keep-Alive".
httpClient.Timeout = TimeSpan.FromMinutes(10);
vs
httpClient.DefaultRequestHeaders.Add("Connection", "Keep-Alive"); httpClient.DefaultRequestHeaders.Add("Keep-Alive", "600");
Upvotes: 0
Views: 256
Reputation: 151654
The timeout is the time the client will wait for a response. Keep-alive is for reusing an already opened TCP connection for subsequent HTTP requests.
Upvotes: 1