sfarmar/Samples — pull request #2 by SeanFeldman (2014-09-03 01:41:00+00:00)
Title: caching HttpClient to avoid pool exhaustion

From HttpClient [MSDN](http://msdn.microsoft.com/en-us/library/system.net.http.httpclient(v=vs.110).aspx):

The HttpClient class instance acts as a session to send HTTP requests. An HttpClient instance is a collection of settings applied to all requests executed by that instance. In addition, every HttpClient instance uses its own connection pool, isolating its requests from requests executed by other HttpClient instances.

Using IDisposable defeats connection pooling. Since you are implicitly creating an new connection pool on every post. The fix is to share the “HttpClient” object and not create a new instance of that object on every request.