What happens if I set the pool_connections parameter to 0 for request sessions?

Viewed 47
s = requests.Session()
s.mount('https://', HTTPAdapter(pool_connections=1))
s.get('https://www.baidu.com')
  • In the above code what will happen if I set the pool_connections to 0 instead of 1?
  • Will it work normally like requests.get() method?
  • Also if it works like requests.get() then can I mount pool_connections=0 for some specific domain prefixes?
1 Answers

Found the answer, upon setting pool_connections = 0 it will give the following error

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='baidu.com', port=443): Pool is closed.

Related