With httpClient
I do a POST request, however, the problem is that even if there
is no connection because the destination API is down, it does not return any errors.
using (var httpClient = new HttpClient())
{
httpClient.BaseAddress = new Uri(proxySettingsConfiguration.BaseAdress);
var json = JsonConvert.SerializeObject(item);
var parameters = new Dictionary<string, string> { { "Application", "Demo" }, { "Payload", json } };
var encodedContent = new FormUrlEncodedContent(parameters);
var response = await httpClient.PostAsync(proxySettingsConfiguration.RequestUri, encodedContent);
}
Is there a way to check beforehand if the destination works? Without using PING