python中请求https请求

2022/6/7 1:21:58

本文主要是介绍python中请求https请求,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

在请求的时候加上 verify=False 即可

if method == METHOD_GET:
    res = requests.get(url=url, headers=headers, verify=False)
elif method == METHOD_POST:
    res = requests.post(url=url, json=data, headers=headers, verify=False)
elif method == METHOD_PUT:
    res = requests.put(url=url, json=data, headers=headers, verify=False)
elif method == METHOD_DELETE:
    res = requests.delete(url=url, json=data, headers=headers, verify=False)


这篇关于python中请求https请求的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程