Core logic ported from TS: HttpClientFactory, Environment and WebSocketHandler.
This commit is contained in:
19
Core/HttpClientFactory.cs
Normal file
19
Core/HttpClientFactory.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
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)
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user