Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2.  
  3. $ch = curl_init();
  4.  
  5. curl_setopt($ch, CURLOPT_URL, "https://api.voluum.com/auth/session");
  6. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  7. curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"email\":\"voluumdemo@voluum.com\",\"password\":\"1qaz!QAZ\"}");
  8. curl_setopt($ch, CURLOPT_POST, 1);
  9.  
  10. $headers = array();
  11. $headers[] = "Content-Type: application/json; charset=utf-8";
  12. $headers[] = "Accept: application/json";
  13. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  14.  
  15. $result = curl_exec($ch);
  16.  
  17. print_r($result);
  18.  
  19. if (curl_errno($ch)) {
  20. echo 'Error:' . curl_error($ch);
  21. }
  22. curl_close ($ch);
  23.  
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement