import requests
import urllib3
urllib3.disable_warnings()
url = 'https://coding.imooc.com/api/cate'
data = {
"apiname": "cate",
"cid": 0,
"secrect": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWUiOiI1MDUxNTQwIiwianRpIjoiMjc5OWUyMTNhOWY2NTJhNWJlMTE5MzU0MmUzODQwNDUiLCJkZXZpY2UiOiJtb2JpbGUifQ.EYHnj9qoAGX32SDiGhGj36FuU_4MY42TGrBASnfbJ7c",
"timestamp": "1554213141535",
"token": "17f5148f2d2ca10bdbb850dd0ab2171a",
"uid": "5051540",
}
def send_post(url,data,):
res = requests.post(url=url,data=data)
return res.json()
print(send_post(url,data))
报错信息:
requests.exceptions.SSLError: HTTPSConnectionPool(host=‘coding.imooc.com’, port=443): Max retries exceeded with url: /api/cate (Caused by SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)’),))