python性能测试工具Locust (探坑)

2021-05-06  本文已影响0人  Nikon937

问题一、

执行请求时,warning警告:

InsecureRequestWarning: Unverified HTTPS request is being made to host 'www.cnblogs.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  warnings.warn(
![image.png](https://img.haomeiwen.com/i4899983/0a67dc27143942a5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

解决方案:

import urllib3
import requests  # 导入requests
urllib3.disable_warnings()
session = requests.session()
# SSL证书验证的方法:加参数:verify=证书路径,或verify=False 不验证ssl 默认为True
上一篇下一篇

猜你喜欢

热点阅读