2022-04-10 03:38:39 +03:00
|
|
|
|
using System.Net.Http;
|
2023-07-16 01:07:20 +03:00
|
|
|
|
using System.Net.Http.Headers;
|
|
|
|
|
using System.Reflection;
|
2022-04-10 03:38:39 +03:00
|
|
|
|
|
|
|
|
|
namespace YoutubeDownloader.Core.Utils;
|
|
|
|
|
|
2023-07-03 20:43:17 +02:00
|
|
|
|
public static class Http
|
2022-04-10 03:38:39 +03:00
|
|
|
|
{
|
2023-10-21 17:58:59 +03:00
|
|
|
|
public static HttpClient Client { get; } =
|
|
|
|
|
new()
|
2023-07-16 01:07:20 +03:00
|
|
|
|
{
|
2023-10-21 17:58:59 +03:00
|
|
|
|
DefaultRequestHeaders =
|
2023-07-16 01:07:20 +03:00
|
|
|
|
{
|
2023-10-21 17:58:59 +03:00
|
|
|
|
// Required by some of the services we're using
|
|
|
|
|
UserAgent =
|
|
|
|
|
{
|
|
|
|
|
new ProductInfoHeaderValue(
|
|
|
|
|
"YoutubeDownloader",
|
|
|
|
|
Assembly.GetExecutingAssembly().GetName().Version?.ToString(3)
|
2024-09-01 23:25:50 +03:00
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
},
|
2023-10-21 17:58:59 +03:00
|
|
|
|
};
|
|
|
|
|
}
|