I have something like the following
public async Task PostTest()
using (var client = new HttpClient())
client.BaseAddress = new Uri("abc.com");
var response = await client.PostAsync("/api/call", new StringContent("hello world"));
//do something with response and dispose it.
//NOTE: server is long running, so dispose is not getting called before sending other remaning requests.
Just in case anyone else is curious, I inspected the
HttpClient code a little bit, and it looks like each
HttpClient instantiates an
HttpMessageHandler per instance. The
HttpMessageHandler object creates a hash code per instance which gets used to create
ServicePoint objects, in addition to the schema and domain of the uri defined by the