Пример #1
0
        public string httpNewConnectionHandler(HttpListenerContext context)
        {
            HttpListenerRequest request = context.Request;

            //bool isSecureConnection = request.IsSecureConnection; //get if connection is secured or not
            //get relevant html pgae code
            if (request.HttpMethod == "GET")
            {
                string requestedPage = request.RawUrl;

                return(HtmlPageManager.findPageByName(requestedPage));
            }
            else
            {
                return(handlePostRequest(request));
            }
        }
Пример #2
0
        private string purchaseStress(Dictionary <string, string> parameters)
        {
            var reqInfoBad  = new { cardNumber = "1", month = "1", year = "2020", holder = "1", ccv = "1" };
            var dataObjBad  = new { id = -10, data = reqInfoBad };
            var reqInfoGood = new { cardNumber = "1", month = "1", year = "2020", holder = "1", cvv = "1", id = "1", name = "1", address = "a", city = "c", country = "3", zip = "1" };
            var dataObjGood = new { id = -10, data = reqInfoGood };

            if (parameters["purchaseType"] == "good")
            {
                buyShoppingBasketHandler(JObject.Parse(JsonHandler.SerializeObject(dataObjGood)), "");
            }
            else
            {
                buyShoppingBasketHandler(JObject.Parse(JsonHandler.SerializeObject(dataObjBad)), "");
            }

            return(HtmlPageManager.findPageByName("/wot/shoppingbasket"));
        }