Python中request的post请求报requests.exceptions.SSLError:

今天发送一个post请求,提示错误

requests.exceptions.SSLError: HTTPSConnectionPool(host='user.zaful.com', port=443): Max retries exceeded with url: /m-users-a-act_sign.htm (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')))

解决方案,在请求时,关闭ssl链接’verify=False

url="https://user.XX.com/m-users-a-act_sign.htm"
        data={'pipeline':"zf",'email':'[email protected]','password':'zhang123'}
        head={"Accept": "application/json, text/javascript, */*; q=0.01"}
        result=requests.post(url,data=data,headers=head,verify=False)

  

登录成功,问题解决

猜你喜欢

转载自www.cnblogs.com/chongyou/p/11512642.html