Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
3,277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1. <?php
  2.  
  3. $id = '{{imageHash}}';
  4.  
  5. $curl = curl_init();
  6.  
  7. curl_setopt_array($curl, array(
  8. CURLOPT_URL => "https://srv2.zoomable.ca/api/image/" . $id,
  9. CURLOPT_RETURNTRANSFER => true,
  10. CURLOPT_ENCODING => "",
  11. CURLOPT_MAXREDIRS => 10,
  12. CURLOPT_TIMEOUT => 30,
  13. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  14. CURLOPT_CUSTOMREQUEST => "GET",
  15. CURLOPT_HTTPHEADER => array(
  16. "cache-control: no-cache",
  17. ),
  18. ));
  19.  
  20. $response = curl_exec($curl);
  21. $err = curl_error($curl);
  22.  
  23. curl_close($curl);
  24.  
  25. if ($err) {
  26. echo "cURL Error #:" . $err;
  27. } else {
  28. echo $response;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement