This commit is contained in:
2021-08-12 18:40:08 +00:00
parent 39793dc7e4
commit c3288d40f7
2 changed files with 22 additions and 27 deletions

View File

@@ -21,7 +21,7 @@ namespace AyaNova.PlugIn.V8
public static GZTW.AyaNova.BLL.LocalizedTextTable LocaleText = null;
const string TEST_ROUTE = "notify/hello";
const string API_BASE_ROUTE = "api/v8/";
public static HttpClient client = null;
public static HttpClient client = new HttpClient();
//url once known to be good
internal static string ApiBaseUrl { get; set; }
internal static string JWT { get; set; }
@@ -40,11 +40,11 @@ namespace AyaNova.PlugIn.V8
private static void InitClient()
{
if (Initialized) return;
if (client != null)
client.Dispose();
client = null;
client = new HttpClient();
client.Timeout = new TimeSpan(0, 0, 30);
//if (client != null)
// client.Dispose();
//client = null;
//client = new HttpClient();
client.Timeout = new TimeSpan(0, 1, 0);
client.BaseAddress = new Uri(ApiBaseUrl);
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));