我正在尝试使用Python脚本登录网站。请帮助我
url = 'http://12.345.67.891:8000/login'
values = {'username': 'abcdefg',
'password': 'apple'}
r = requests.post(url, data=values)
print r.content
执行代码时出现以下错误
[{"fieldNames":["User"],"classification":"RequiredError","message":"Required"}]
答案 0 :(得分:3)
也许期望User
而不是username
:
url = 'http://12.345.67.891:8000/login'
values = {'User': 'abcdefg',
'password': 'apple'}
r = requests.post(url, data=values)
print(r.content)