import requests
import json
headers = {"Content-Type": "application/json"}
url = 'https://xxx'
d = {"var": [1, 2, 3]}
r = requests.post(url, headers=headers, json=d) # 发get请求
print(r.status_code, r.json())
发现报错:
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed: certificate has expired (_ssl.c:1131)
requests.exceptions.SSLError: HTTPSConnectionPool(host='xxx', port=xxx):
Max retries exceeded with url: /xxx
(Caused by SSLError(SSLCertVerificationError
(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed:
certificate has expired (_ssl.c:1131)')))
修改方法:文章来源:https://www.toymoban.com/news/detail-554417.html
把 url
的 https 改为 http
不报错了文章来源地址https://www.toymoban.com/news/detail-554417.html
到了这里,关于requests.exceptions.SSLError: HTTPSConnectionPool Max retries exceeded with url 报错解决方法的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!