📜  超出 https 连接池最大重试次数 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:44.752000             🧑  作者: Mango

代码示例1
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry


session = requests.Session()
retry = Retry(connect=3, backoff_factor=0.5)
adapter = HTTPAdapter(max_retries=retry)
session.mount('http://', adapter)
session.mount('https://', adapter)

session.get(url)