private void sendgetrequest()
        {
            Dictionary <string, string> httpheader = new Dictionary <string, string>();

            httpheader.Add("Accept", "application/json");
            restResponse = httpClientAsyncHelper.PerformGetRequest(delayurl, httpheader).GetAwaiter().GetResult();

            //List<JsonRootObject> jsonroot = JsonConvert.DeserializeObject<List<JsonRootObject>>(restResponse.ResponseContent);
            //Console.WriteLine(jsonroot[0].BrandName.ToString());

            List <JsonRootObject> jsondata = ResponseDataHelper.DeserializeJSONResponse <List <JsonRootObject> >(restResponse.ResponseContent);

            Console.WriteLine(jsondata[1].ToString());
        }
        private void SendGetRequest()
        {
            Dictionary <string, string> httpHeader = new Dictionary <string, string>();

            httpHeader.Add("Accept", "application/json");

            RestResponse restResponse = httpClientAsyncHelper.PerformGetRequest(delayGetUrl, httpHeader).GetAwaiter().GetResult();

            //List<JsonRootObject> jsonRootObject = JsonConvert.DeserializeObject<List<JsonRootObject>>(restResponse.ResponseContent);
            //Console.WriteLine(jsonRootObject[0].ToString());
            Assert.AreEqual(200, restResponse.StatusCode);

            List <JsonRootObject> jsonData = ResponseDataHelper.DeserializeJsonResponse <List <JsonRootObject> >(restResponse.ResponseContent);

            Console.WriteLine(jsonData[0].ToString());
        }
Exemple #3
0
        private RestResponse GetRestReponse()
        {
            Dictionary <string, string> httpHeader = new Dictionary <string, string>();

            httpHeader.Add("X-Yandex-API-Key", AccessToken);
            httpHeader.Add("Accept", "application/json");

            RestResponse restResponse = HttpClientAsyncHelper.PerformGetRequest(Uri, httpHeader).GetAwaiter().GetResult();

            Assert.AreEqual(200, restResponse.StatusCode);
            return(restResponse);
        }