Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import requests
  4.  
  5. payload = 'username=myusername&password=password'
  6. headers = {'X-Application': 'SomeKey', 'Content-Type': 'application/x-www-form-urlencoded'}
  7.  
  8. resp = requests.post('https://identitysso.betfair.com/api/certlogin', data=payload, cert=('client-2048.crt', 'client-2048.key'), headers=headers)
  9.  
  10. if resp.status_code == 200:
  11. resp_json = resp.json()
  12. print resp_json['loginStatus']
  13. print resp_json['sessionToken']
  14. else:
  15. print "Request failed."
  16.  
  17. URLFetch[" https://identitysso.betfair.com/api/certlogin", {"StatusCode", "Headers", "Content"}, "Headers" -> {"X-Application" -> "nilostep", "Accept" ->,"application/json"}, "Parameters" -> {"Username" -> "myusername", "Password" -> "mypassword"}];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement