Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. function getCurl($url)
  2. {
  3. $curl = curl_init();
  4.  
  5. curl_setopt_array($curl, array(
  6. CURLOPT_SSL_VERIFYHOST => 2,
  7. CURLOPT_SSL_VERIFYHOST => 2,
  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 => "POST",
  14. CURLOPT_HTTPHEADER => array(
  15. // Set Here Your Requesred Headers
  16. 'public-key: VXGNq3GcR73gNJ2FLN2cMZwHPPujy71yrveK0scORS7KzoXWVyjXjh6vzZ1spvzg',
  17.  
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement