Advertisement
Guest User

Untitled

a guest
Sep 15th, 2014
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. curl -q -k --cert client-2048.crt --key client-2048.key https://identitysso.betfair.com/api/certlogin -d "username=testuser&password=testpassword" -H "X-Application: curlCommandLineTest"
  2.  
  3. Response should be
  4.  
  5. {"sessionToken":"Zx8i4oigut5nc+l4L8qFb0DSxG+mwLn2t0AMGFxjrMJI=","loginStatus":"SUCCESS"}
  6.  
  7. $ch = curl_init();
  8.  
  9. curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-Application: $applicationkey'));
  10. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  11. curl_setopt($ch, CURLOPT_URL, "https://identitysso.betfair.com/api/certlogin");
  12.  
  13. $fields = array('username' => urlencode($username),'password' => urlencode($password));
  14. foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
  15. rtrim($fields_string, '&');
  16.  
  17. curl_setopt($ch,CURLOPT_POST, count($fields));
  18. curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
  19.  
  20. $data = curl_exec($ch);
  21. curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement