Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // URL
- $url = 'https://api.eu.sparkpost.com/api/v1/recipient-validation/single/ab@northfinance.dk';
- // CURL
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_USERPWD, 'API_KEY');
- curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- // RESULT
- $result = json_decode(curl_exec($ch), true);
- $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- curl_close($ch);
- echo $result;
- die();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement