Guest User

Untitled

a guest
Jan 24th, 2020
70
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function getCurl($url)
  2. {
  3. $curl = curl_init();
  4.  
  5. curl_setopt_array($curl, array(
  6. CURLOPT_SSL_VERIFYHOST => false,
  7. CURLOPT_SSL_VERIFYHOST => false,
  8. CURLOPT_URL => $url,
  9. CURLOPT_RETURNTRANSFER => true,
  10. CURLOPT_ENCODING => "",
  11. CURLOPT_TIMEOUT => 30000,
  12. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  13. CURLOPT_CUSTOMREQUEST => "GET",
  14. CURLOPT_HTTPHEADER => array(
  15. // Set Here Your Requesred Headers
  16. 'public-key: VXGNq3GcR73gNJ2FLN2cMZwHPPujy71yrveK0scORS7KzoXWVyjXjh6vzZ1spvzg',
  17. 'Content-Type: application/json',
  18. ),
  19. ));
  20. $response = curl_exec($curl);
  21. $err = curl_error($curl);
  22. curl_close($curl);
  23.  
  24. if ($err) {
  25. $result = "cURL Error #:" . $err;
  26. } else {
  27. $result = json_decode($response);
  28. }
  29. return $result;
  30. }
RAW Paste Data