Guest User

Untitled

a guest
May 17th, 2018
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. import requests
  2.  
  3.  
  4. url = "https://minhaapi.com/v1/login/username"
  5.  
  6. querystring = {"countryCode":"BR"}
  7.  
  8. payload = "username=user&password=teste123&clientVersion=2.4.9-undefined"
  9. headers = {
  10. 'Content-Type': "application/x-www-form-urlencoded",
  11. 'x-requested-with': "XMLHttpRequest",
  12. 'x-tidal-token': "wdgaB1CilGA-S_s2"
  13. }
  14.  
  15. response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
  16.  
  17. print(response.text)
  18.  
  19.  
  20.  
  21. Resposta da minha API(Quando o usuário está cadastrado):
  22.  
  23.  
  24.  
  25. {"userId":57261722,"sessionId":"5b1ada5b-addf-4804-a55e-a12f36959ff1","countryCode":"BR"}
  26.  
  27. for url in response.text:
  28. if 'userId' in url.lower():
  29. print ("OK")
Add Comment
Please, Sign In to add comment