我正在为iObeya使用restapi,我希望使用Python请求,但是目前我无法通过服务器进行身份验证。文档声明您可以使用POST请求进行身份验证,并且在返回时,您应该在身份验证正确时获得一个名为“JSESSIONID”的cookie。你知道吗
到目前为止,我有:
url = 'https://link-to.com/iobeya/'
auth_url = 'https://link-to.com/iobeya/j_spring_security_check'
headers = {"content-type": "application/x-www-form-urlencoded; charset=utf-8"}
session = requests.Session()
session.auth = ("username", "password")
auth = session.post(url, verify=False)
r = session.get(url, verify=False, headers=headers)
print(r.status_code)
print(r.headers)
print(r.cookies)
Cookie的返回为空。这是使用POST方法执行身份验证请求的正确方法吗?你知道吗
它只想让你用
username
和password
写一篇普通的文章。你知道吗相关问题 更多 >
编程相关推荐