title: How to parse JSON in Windows Store / Windows Phone App
body: <p>The url that I have returns follwing JSON</p>
  
  <pre><code>[{"Id":21,"Name":"Pop","Description":"Pop Music"},{"Id":22,"Name":"Classical","Description":"Classical Music"},{"Id":23,"Name":"Rock","Description":"Rock Music"}]
  </code></pre>
  
  <p>and I want to populate <code>List&lt;Genre&gt; genreList;</code>
  where Genre looks like</p>
  
  <pre><code>class Genre
  {
    int Id{get;set;}
    string Pop{get;Set;}
    string Description {get;set;}
  }
  </code></pre>
  
  <p>I wrote following code but it is not at all working </p>
  
  <pre><code>public List&lt;Genre&gt; GetAllGenres()
          {
              var client = new HttpClient();
              HttpResponseMessage response =  client.G(new Uri("http://localhost/MusicAPI/api/Genre/GetAllGenres/"));
              var jsonString =  response.Content.ReadAsString();
  
              List&lt;Genre&gt; list = await Newtonsoft.Json.JsonConvert.DeserializeObject&lt;Genre[]&gt;(jsonString);
              return list;
          }
  </code></pre>
  
  <p>Please suggest..</p>
  
  <p>Here is the answer given by Jagath</p>
  
  <pre><code> public GenreItemViewer()
          {
              this.InitializeComponent();
              GetResponse();
          }
  
          public async void GetResponse()
          {
              var postRequest = (HttpWebRequest)WebRequest.Create("http://localhost/MusicAPI/api/Genre/GetAllGenres/");
              postRequest.Method = "GET";
              postRequest.CookieContainer = new CookieContainer(); ;
  
              HttpWebResponse postResponse = (HttpWebResponse)await postRequest.GetResponseAsync();
              string response = String.Empty;
              if (postResponse != null)
              {
                  var postResponseStream = postResponse.GetResponseStream();
                  var postStreamReader = new StreamReader(postResponseStream);
  
                  response = await postStreamReader.ReadToEndAsync();
              }
  
              List&lt;Genre&gt; list = Newtonsoft.Json.JsonConvert.DeserializeObject&lt;List&lt;Genre&gt;&gt;(response);
          }
  </code></pre>