title: curl not returning JSON data as expected
body: <p>I have the following code, where i am basically just doing a curl request to get the JSON data back.. the URL to the request should be:</p>
  <pre><code> https://www.instagram.com/reel/CiAbVWmpiWR/?__a=1&amp;__d=dis
  </code></pre>
  <p>so even if i just copy and paste the link above into the browser i can see the JSON data, however when putting it into code and requesting via CURL.. it just returns Oops an error occured.. what am i doing wrong ?</p>
  <pre><code>$mediaUrl = 'https://www.instagram.com/reel/CiAbVWmpiWR';
  $pos = strpos($mediaUrl, '?');
  if ($pos) {
      $mediaUrl = substr($mediaUrl, 0, $pos);
  }
  $url = rtrim($mediaUrl, '/') . '/?__a=1&amp;__d=dis';
  
  //var_dump($url);
  
  $proxy = '139.99.54.49:10163';
  $proxyauth = 'aditya:xcQWzyfX7ybNM8d';
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_PROXY, $proxy);     // PROXY details with port
  curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth);   // Use if proxy have username and password
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json') );
  $data = curl_exec($ch);
  if (curl_errno($ch)) {
      $error_msg = curl_error($ch);
      var_dump($error_msg);
  }
  
  
  $json_data = json_decode($data, true);
  var_dump($data);
  </code></pre>
  <p>so var_dump data returns</p>
  <pre><code>string(25) &quot;Oops, an error occurred.
  
  curl_errno($ch) is always NULL
  </code></pre>
  <p><strong>UPDATE:</strong></p>
  <p>when the URL is not an instagram reel photo, just a regular photo like an example below:</p>
  <p><a href="https://www.instagram.com/p/CiPR10FhwZ6/?__a=1&amp;__d=dis" rel="nofollow noreferrer">https://www.instagram.com/p/CiPR10FhwZ6/?__a=1&amp;__d=dis</a></p>
  <p>the code above works perfectly fine</p>