This commit is contained in:
22
util.cs
22
util.cs
@@ -10,6 +10,17 @@ namespace raven_integration
|
||||
{
|
||||
public static class Util
|
||||
{
|
||||
//#######################################################################################################
|
||||
public static string API_BASE_URL = "http://localhost:7575/api/v8/";
|
||||
//public static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/";
|
||||
public static string TEST_DATA_FOLDER = @"..\..\..\testdata\";
|
||||
|
||||
public const decimal TIME_ZONE_ADJUSTMENT = -7;
|
||||
//#######################################################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
public const string OpEquality = "=";
|
||||
public const string OpGreaterThan = ">";
|
||||
public const string OpGreaterThanOrEqualTo = ">=";
|
||||
@@ -24,10 +35,7 @@ namespace raven_integration
|
||||
|
||||
private static HttpClient client { get; } = new HttpClient();
|
||||
|
||||
public static string API_BASE_URL = "http://localhost:7575/api/v8/";
|
||||
//public static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/";
|
||||
|
||||
public static string TEST_DATA_FOLDER = @"..\..\..\testdata\";
|
||||
|
||||
|
||||
public static ConcurrentDictionary<string, string> authDict = new ConcurrentDictionary<string, string>();//10,32
|
||||
|
||||
@@ -41,8 +49,6 @@ namespace raven_integration
|
||||
|
||||
public async static Task<string> GetTokenAsync(string login, string password = null)
|
||||
{
|
||||
// Console.WriteLine($"GetTokenAsync:{login}");
|
||||
//System.Diagnostics.Trace.WriteLine($"GetTokenAsync:{login}");
|
||||
|
||||
if (password == null)
|
||||
password = login;
|
||||
@@ -141,12 +147,12 @@ namespace raven_integration
|
||||
public async static Task<ApiTextResponse> GetNonApiPageAsync(string route)
|
||||
{
|
||||
init();
|
||||
var requestMessage = new HttpRequestMessage(HttpMethod.Get, CleanNonApiRoute(route));
|
||||
var requestMessage = new HttpRequestMessage(HttpMethod.Get, CleanNonApiRoute(route));
|
||||
HttpResponseMessage response = await client.SendAsync(requestMessage);
|
||||
var responseAsString = await response.Content.ReadAsStringAsync();
|
||||
return new ApiTextResponse() { HttpResponse = response, TextResponse = responseAsString };
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user