This commit is contained in:
2021-08-13 18:36:54 +00:00
parent 5ea07cd003
commit f8609e59ec
3 changed files with 22 additions and 21 deletions

View File

@@ -25,13 +25,13 @@ namespace AyaNova.PlugIn.V8
//url once known to be good
internal static string ApiBaseUrl { get; set; }
internal static string JWT { get; set; }
public static bool Initialized { get; set; }
// public static bool Initialized { get; set; }
internal static string ServerState { get; set; }
public util()
{
Initialized = false;
// Initialized = false;
JWT = string.Empty;
}
@@ -39,17 +39,17 @@ namespace AyaNova.PlugIn.V8
#region INIT / AUTH
private static void InitClient()
{
if (Initialized) return;
// if (Initialized) return;
//if (client != null)
// client.Dispose();
//client = null;
//client = new HttpClient();
client.Timeout = new TimeSpan(0, 1, 0);
client.Timeout = new TimeSpan(0, 0, 45);
client.BaseAddress = new Uri(ApiBaseUrl);
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
// client.DefaultRequestHeaders.Add("X-AY-Import-Mode", "true");
Initialized = true;
//Initialized = true;
}
/// <summary>
@@ -57,7 +57,7 @@ namespace AyaNova.PlugIn.V8
/// </summary>
/// <param name="serverUrl"></param>
/// <returns></returns>
public static async Task<string> TestUrlAsync(string serverUrl)
public static async Task<string> InitAndConfirmAddressAsync(string serverUrl)
{
ApiBaseUrl = serverUrl;
InitClient();