fork download
  1. <?php
  2.  
  3. $headers = [
  4. "Accept: application/json",
  5. "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"
  6. ];
  7.  
  8. $code = 'AF';
  9. $url = "https://w...content-available-to-author-only...l.int/notices/v1/red?&nationality={$code}&resultPerPage=160";
  10.  
  11. $ch = curl_init();
  12.  
  13. curl_setopt($ch, CURLOPT_URL, $url);
  14. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  15. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  16.  
  17. $response = curl_exec($ch);
  18.  
  19. if(curl_errno($ch)) {
  20. echo 'Error: ' . curl_error($ch);
  21. } else {
  22. echo 'Response: ' . $response;
  23. }
  24.  
  25.  
  26. ?>
Success #stdin #stdout 0.03s 26360KB
stdin
Standard input is empty
stdout
Error: Could not resolve host: ws-public.interpol.int