title: c# get JSON file from url
body: <p>For a few days I am trying to find a way to get <a href="https://www.ah.nl/producten/product/wi224735" rel="nofollow noreferrer">this URL</a> to a JSON file.</p>
  
  <p>When you visit the above url you see a page with a product on it. This page loads <a href="https://www.ah.nl/service/rest/delegate?url=%2Fproducten%2Fproduct%2Fwi224735%2Fdoritos-nacho-cheese&amp;_=1513938720642" rel="nofollow noreferrer">this URL</a> to a JSON file with all the product information in it.</p>
  
  <p>I want to get this file when I enter the first URL in my C# program so I can extract the data, but I have no idea how to get to this file. </p>
  
  <p>This is how far I got:</p>
  
  <pre><code>    static void Main(string[] args)
      {
          GetRequest("https://www.ah.nl/producten/product/wi224735");
          Console.ReadKey();
      }
  
  
  
      async static void GetRequest(string url)
      {
          using (HttpClient client = new HttpClient())
          {
              using (HttpResponseMessage response = await client.GetAsync(url))
              {
                  using (HttpContent content = response.Content)
                  {
                      string mycontent = await content.ReadAsStringAsync();
                      //HttpContentHeaders headers = content.Headers;
                      Console.WriteLine(mycontent);
                  }
              }
          }
      }
  </code></pre>
  
  <p>But this console app reads the header or the HTML and not the JSON file.</p>
  
  <p>Can anybody help me on my way?</p>