Ejemplo n.º 1
0
        //Ramesh sample Code
        #region ramesh

        public async void getphonenumber()
        {
            string   url = "https://konnectprodstream3.knowlarity.com:8200/update-stream/7887d237-b541-11e6-9504-066beb27a027/konnect";
            callinfo x   = await GetProductAsync(url);

            //HttpClient client = new HttpClient();
            //string url = "https://konnectprodstream3.knowlarity.com:8200/update-stream/7887d237-b541-11e6-9504-066beb27a027/konnect";
            //var getStringTask = client.GetStringAsync(url);
        }
Ejemplo n.º 2
0
        static async Task RunAsync()
        {
            //HttpClient client = new HttpClient();
            string url = "https://konnectprodstream3.knowlarity.com:8200/update-stream/7887d237-b541-11e6-9504-066beb27a027/konnect";

            // New code:
            client.BaseAddress = new Uri(url);
            client.DefaultRequestHeaders.Accept.Clear();
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            callinfo callinfo = await GetProductAsync(url);
        }
Ejemplo n.º 3
0
        static async Task <callinfo> GetProductAsync(string path)
        {
            // HttpClient client = new HttpClient();
            callinfo            product  = null;
            HttpResponseMessage response = await client.GetAsync(path);

            if (response.IsSuccessStatusCode)
            {
                product = await response.Content.ReadAsAsync <callinfo>();
            }
            return(product);
        }