title: calling rest api on client side c#
body: <p>I am new to api stuff.
  I want to get the result of this api(<a href="http://services.groupkt.com/country/get/all" rel="nofollow noreferrer">http://services.groupkt.com/country/get/all</a>) in c# code. can you help me by suggesting any code and tutorial as well. thanks
  i have tried this code but it doesnot work.</p>
  
  <pre><code>public async Task DownloadData()
  {
      string url = string.Format("http://services.groupkt.com/country/get/all");
  
      HttpClient client = new HttpClient();
      client.DefaultRequestHeaders.Add("Accept", "application/json");
  
      var jsonString = await client.GetStringAsync(url);
  
      JToken token = JToken.Parse(jsonString);
  
      foreach (var item in token)
      {
          txtarea.Value= item.ToString();
      }
  }
  </code></pre>