mirror of
https://github.com/healthchecks/healthchecks.git
synced 2024-11-27 01:27:51 +00:00
361 B
361 B
C#
Below is an example of making an HTTP request to SITE_NAME from C#.
try
{
using (var client = new System.Net.Http.HttpClient())
{
client.Timeout = System.TimeSpan.FromSeconds(10);
client.GetAsync("PING_URL").Wait();
}
}
catch (System.Exception ex)
{
System.Console.WriteLine($"Ping failed: {ex.Message}");
}