fork download
  1. <?php
  2. $url = "http://115.245.30.253:8080/demo.php"; // API URL
  3.  
  4. // Initialize cURL session
  5. $ch = curl_init();
  6. curl_setopt($ch, CURLOPT_URL, $url);
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  8. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Disable SSL verification if needed
  9.  
  10. // Execute cURL request
  11. $json = curl_exec($ch);
  12.  
  13. // Check for cURL errors
  14. if ($json === false) {
  15. die("cURL Error: " . curl_error($ch));
  16. }
  17.  
  18. // Close cURL session
  19.  
  20. // Check if response is empty
  21. if (empty($json)) {
  22. die("No data found.");
  23. }
  24.  
  25. ?>
  26.  
Success #stdin #stdout 0.03s 25724KB
stdin
Standard input is empty
stdout
cURL Error: