title: How to get data by api use Windows Form
body: <p>On the browser, I could get data like this.(JSON format)
  <a href="https://i.stack.imgur.com/Ibd0h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ibd0h.png" alt="enter image description here"></a></p>
  
  <p>I want to perform HTTP requests and <code>get</code> data on WinForm. How can I do to make it like the below picture?</p>
  
  <p><a href="https://i.stack.imgur.com/KTTCg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KTTCg.png" alt="enter image description here"></a></p>
  
  <p>I have referred to some relevant information. But I am confused how to start (like I should write code in Form1.cs or add new class, should I create model...)</p>
  
  <p><a href="https://stackoverflow.com/questions/4015324/how-to-make-http-post-web-request">How to make HTTP POST web request</a></p>
  
  <p><a href="https://stackoverflow.com/questions/45089300/how-to-return-async-httpclient-responses-back-to-winform">How to return async HttpClient responses back to WinForm?</a></p>
  
  <p>Can I use HttpClient Method? Thanks for answer and suggestion.</p>
  
  <hr>
  
  <p>(New edit)</p>
  
  <p><a href="https://www.youtube.com/watch?v=PwH5sc-Q_Xk" rel="nofollow noreferrer">https://www.youtube.com/watch?v=PwH5sc-Q_Xk</a></p>
  
  <p>I also learned from this video, But I got error message.</p>
  
  <blockquote>
    <p>No MediaTypeFormatter is available to read an object of type 'IEnumerable`1' from content with media type 'text/html'.</p>
  </blockquote>
  
  <p><strong>My code</strong></p>
  
  <h1>Form1.cs</h1>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Windows.Forms;
  using System.Net.Http;
  using System.Net.Http.Formatting;
  
  namespace _123
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
          private void button1_Click(object sender, EventArgs e)
          {
              HttpClient clint = new HttpClient();
              clint.BaseAddress = new Uri("http://localhost:8888/");
              HttpResponseMessage response = clint.GetAsync("PersonList").Result;
  
              var emp = response.Content.ReadAsAsync&lt;IEnumerable&lt;ImgList&gt;&gt;().Result;
              dataGridView1.DataSource = emp;
          }
      }
  }
  </code></pre>
  
  <h1>ImgList.cs  (Is this Model?)</h1>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Net;
  using System.Net.Http.Headers;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace _123
  {
      class ImgList
      {
          public int id { get; set; }
          public string name { get; set; }
          public int age { get; set; }
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/5iH3x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5iH3x.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/cB8Yb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cB8Yb.png" alt="enter image description here"></a></p>