Пример #1
0
        private static void Main(string[] args)
        {
            try
            {
                CreateAppConfig();
                var apiServiceUrl = "http://localhost:24003/";
                var timestamp     = UnixEpochHelper.GetCurrentUnixTimestamp().TotalMilliseconds
                                    .ToString(CultureInfo.InvariantCulture);
                var nonce     = new Random().NextDouble().ToString(CultureInfo.InvariantCulture);
                var signature = SignatureHelper.Create(_appSecret, timestamp, nonce);
                var appended  =
                    $"&signature={signature}&timestamp={timestamp}&nonce={nonce}&appid={_appId}";

                var queryUrl = apiServiceUrl +
                               "api/Account/GetToken?userId=2c96ff542072420bc8d33bdd73bb9488&passWord=0000" + appended;
                var responeText = SimulateWebRequest.Post(queryUrl, null);
                Console.WriteLine(responeText);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            finally
            {
                Console.ReadLine();
            }
        }