fork download
  1. <?php
  2. // Initialize cURL
  3. $ch = curl_init();
  4.  
  5. // Set options
  6. curl_setopt($ch, CURLOPT_URL, "https://j...content-available-to-author-only...e.com/posts/1");
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  8.  
  9. // Execute and fetch response
  10. $response = curl_exec($ch);
  11.  
  12. // Check for errors
  13. if (curl_errno($ch)) {
  14. echo 'cURL Error: ' . curl_error($ch);
  15. } else {
  16. echo 'Response: ' . $response;
  17. }
  18.  
  19. // Close cURL session
  20. ?>
  21.  
Success #stdin #stdout 0.04s 26112KB
stdin
Standard input is empty
stdout
cURL Error: Could not resolve host: jsonplaceholder.typicode.com