Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. // URL
  2. $url = 'https://api.eu.sparkpost.com/api/v1/recipient-validation/single/ab@northfinance.dk';
  3.  
  4. // CURL
  5. $ch = curl_init($url);
  6. curl_setopt($ch, CURLOPT_USERPWD, 'API_KEY');
  7. curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
  8. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  9. curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  10. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  11. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  12.  
  13. // RESULT
  14. $result = json_decode(curl_exec($ch), true);
  15. $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  16. curl_close($ch);
  17.  
  18. echo $result;
  19. die();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement