【发布时间】:2018-03-13 18:20:50
【问题描述】:
我正在尝试关闭 requests.Session(),但它没有关闭。
s = requests.Session()
s.verify = 'cert.pem'
res1 = s.get("https://<ip>:<port>/<route>")
s.close() #Not working
res2 = s.get("https://<ip>:<port>/<route>") # this is still working which means s.close() didn't work.
如何关闭会话? s.close() 没有抛出任何错误,这也意味着它是一个有效的语法,但我不明白它到底在做什么。
【问题讨论】:
标签: python session https get python-requests