我试图在Python中使用请求时保持登录状态。我尝试过使用会话和cookies,但是我总是遇到一个413无效会话错误。这是我的密码:
s = requests.Session()
url = "http://"+edge_server+":7780/xtvschedule/rest//UserManager/Login"
rsp = s.post(url, json = Body1, auth=("1002","0123"))
print (rsp.status_code)
cookie = rsp.cookies
url ="http://"+edge_server+":7780/xtvschedule/rest//ContentManager/BrowseRecordedAssets"
rsp = s.get(url,cookies=cookie)
print(rsp.status_code)
print(rsp.content)
谢谢你的帮助
目前没有回答
相关问题 更多 >
编程相关推荐