-1

This is my code:

Name = 'admin'
password = '213434'
data = {'Username':Name, 'Password':password}
url = "https://41.32.252.253"

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
resq = requests.post(url=url, verify=False, data=data)
print(resq.text)
print(resq.status_code)
halfer
  • 18,701
  • 13
  • 79
  • 158
tomchen
  • 15
  • 3

1 Answers1

1

Your post URL must be :

https://41.32.252.253/api/system/user_login

And data must be:

data = {'UserName':'admin', 'Password':password} #don't use keywords like Name

So your code must be like:

url = 'https://41.32.252.253/api/system/user_login'
data = {'UserName':'admin', 'Password':password}
resq = requests.post(url=url, verify=False, data=data)
halfer
  • 18,701
  • 13
  • 79
  • 158
Joshua
  • 4,674
  • 1
  • 6
  • 30