我正在使用Python请求2.19.1。 但是我遇到了一个间歇性问题,当我发布到特定的URL时根本没有任何响应。
我正在尝试检查LDAP是否为我提供了无效凭据的预期输出。 格式如下:
requests.post('https://oxhp-member.uhc.com/Member/MemberPortal/j_acegi_security_check',
credentials_payload)
我正在发布
几乎每次都能正常工作。但是有时候,它对此没有任何回应。甚至网络问题也给了我们一些回应。对?为什么我对上述电话没有任何反应。
请求中是否存在任何现有错误?
有人请指出正确的方向。
答案 0 :(得分:1)
requests
不负责“回馈”。您正在使用requests
发布到的服务器是。
要查看响应,您必须将其保存在变量中并以某种方式处理它。
resp = requests.post('https://oxhp-member.uhc.com/Member/MemberPortal/j_acegi_security_check',
credentials_payload)
print(resp.status_code)
print(resp.content)
resp
所包含的内容都是服务器的责任。