19 lines
448 B
C#
19 lines
448 B
C#
using System;
|
|
using System.Net.Http;
|
|
|
|
namespace Chtn.CSharp.SDK.Core
|
|
{
|
|
public static class HttpClientFactory
|
|
{
|
|
public static HttpClient CreateClient(bool isCdn = false)
|
|
{
|
|
var env = EnvironmentConfig.Get();
|
|
return new HttpClient
|
|
{
|
|
BaseAddress = new Uri(isCdn ? env.CdnUrl : env.ApiUrl),
|
|
Timeout = TimeSpan.FromSeconds(5)
|
|
};
|
|
|
|
}
|
|
}
|
|
} |