Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. $username = 'XXXXXXXXXXXXXXXX';
  2. $password = 'XXxxxxxXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
  3.  
  4. $curl = curl_init();
  5.  
  6. curl_setopt($curl, CURLOPT_POST, 1);
  7. curl_setopt($curl, CURLOPT_URL, "https://api.neteller.com/v1/oauth2/token?grant_type=client_credentials");
  8. curl_setopt($curl, CURLOPT_USERPWD, "$username:$password");
  9. curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type:application/json", "Cache-Control:no-cache"));
  10. curl_setopt($curl, CURLOPT_POSTFIELDS, array("scope"=>"default"));
  11. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
  12. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  13. curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
  14. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  15.  
  16. $serverOutput = curl_exec($curl);
  17. $info = curl_getinfo($curl);
  18.  
  19. echo $serverOutput; // null response
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement