How to correct sample example?

  • 1
  • Question
  • Updated 2 years ago
How exactly shall i change sample example 
(this: http://api.wunderground.com/api/MYKEY/conditions/q/CA/San_Francisco.json )

when i want to get this response field: display_location.city

All about this question should be here at this link:
http://www.wunderground.com/weather/api/d/docs?d=data/conditions&MR=1
Photo of Radek

Radek

  • 2 Posts
  • 0 Reply Likes

Posted 2 years ago

  • 1
Photo of Ravi Yadav

Ravi Yadav

  • 82 Posts
  • 8 Reply Likes
Do you have some code written already? The community can help if you share what you already have or the language you are trying to code in. 
Photo of Radek

Radek

  • 2 Posts
  • 0 Reply Likes
C#: This is the whole code which i have in my Form1 :) Everything is working good (textbox on the form shows information about searching) but i dont know how to add some of those parameters (for example wind_string), where exactly should i add it to the link. Because now after start it only writes the nothing was found.

        public Form1()        {
            InitializeComponent();
            DownloadPageAsync();
        }

        async void DownloadPageAsync()
        {
            string page = "http://api.wunderground.com/api/MYKEY/conditions/q/CA/San_Francisco.json";
            string result;
            using (HttpClient client = new HttpClient())
            using (HttpResponseMessage response = await client.GetAsync(page))
            using (HttpContent content = response.Content)
            {
                result = await content.ReadAsStringAsync();
            }
            textBox1.Text = result;
        }
(Edited)