1. 遇到这种错误有可能是机器无外网权限造成的。

  requests.exceptions.ConnectionError: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /s/savecomtajax (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f972f48bf90>: Failed to establish a new connection: [Errno 110] Connection timed out',))

2.  requests 发https 请求时,需要忽略证书的验证, 需要注意如下点。

requests.packages.urllib3.disable_warnings()
def request_ajax_url(login_url,login_body, headers):
'''发送post请求数据'''
req = requests.post(login_url, data=login_body, headers=headers, verify=False);
return req.text

相关文章:

  • 2021-06-19
  • 2022-12-23
  • 2021-11-23
  • 2021-12-29
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
  • 2022-02-22
  • 2022-01-01
相关资源
相似解决方案