Do HttpClient and HttpClientHandler have to be disposed between requests?

The general consensus is that you do not (should not) need to dispose of HttpClient. Many people who are intimately involved in the way it works have stated this. See Darrel Miller’s blog post and a related SO post: HttpClient crawling results in memory leak for reference. I’d also strongly suggest that you read the … Read more

Use of Finalize/Dispose method in C#

The recommended IDisposable pattern is here. When programming a class that uses IDisposable, generally you should use two patterns: When implementing a sealed class that doesn’t use unmanaged resources, you simply implement a Dispose method as with normal interface implementations: public sealed class A : IDisposable { public void Dispose() { // get rid of … Read more