public async Task <string> DefaultGridPostModel([FromBody] DefaultPostModelGridList postModel)
        {
            var headers        = new Dictionary <string, string>();
            var tokenGenerated = HttpContext.Session.GetHmacToken();

            headers.Add("X-Hmac", tokenGenerated);
            headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
            string queryStr = _queryCreater.GetQueryStringFromObject(postModel);
            var    response = await HttpClientRequestFactory.Get("http://proxy.mansis.co.za:18443/SlimProxyBoot.php?" + queryStr, headers);

            var data = response.Content.ReadAsStringAsync().Result;

            return(data.ToString());
        }
예제 #2
0
        public async Task <string> TruckstogoGrid([FromBody] DefaultPostModelGridList gridModel)
        {
            if (ModelState.IsValid)
            {
                var headers        = new Dictionary <string, string>();
                var tokenGenerated = HttpContext.Session.GetHmacToken();
                headers.Add("X-Hmac", tokenGenerated);
                headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
                string queryStr = _queryCreater.GetQueryStringFromObject(gridModel);
                var    response = await HttpClientRequestFactory.Get("http://proxy.mansis.co.za:18443/SlimProxyBoot.php?" + queryStr, headers);

                var data = response.Content.ReadAsStringAsync().Result;
                return(data.ToString());
            }
            else
            {
                throw new Exception("Model state is not valid");
            }
        }