Hello, I am having doubts on how to make fun calls (about 100) simultaneous on a REST service.
The code example I have is the following:
using (var http = new HttpClient { BaseAddress = new Uri("some url") })
{
using (var httpContent = new StringContent(json, Encoding.Default, "application/json"))
{
using (var response = await http.PostAsync("/services/send", httpContent))
{
}
}
}
I would like to know if I need to use await
and async
or if the httpClient
class already has something by default, and if it is possible to make only one connection and send several requests within the same connection