blob: 79e3e5f55f71003eadfbb20ad0640636db618cf5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
namespace LibGit.Extensions;
public static class HttpClientExtensions
{
public static async Task<bool> CheckSuccessStatus(this HttpClient hc, string url)
{
//cors causes failure, try to catch
try
{
var resp = await hc.GetAsync(url);
return resp.IsSuccessStatusCode;
}
catch (Exception e)
{
Console.WriteLine($"Failed to check success status: {e.Message}");
return false;
}
}
}
|