import requests
from requests.adapters import HTTPAdapter

s = requests.Session()
s.mount('http://', HTTPAdapter(max_retries=3))
s.mount('https://', HTTPAdapter(max_retries=3))

s.get('http://example.com', timeout=1)

 

相关文章:

  • 2021-08-07
  • 2021-12-27
  • 2022-12-23
  • 2019-10-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
猜你喜欢
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2022-01-08
  • 2022-12-23
相关资源
相似解决方案