Why doesn’t requests.get() return? What is the default timeout that requests.get() uses?

What is the default timeout that get uses?

The default timeout is None, which means it’ll wait (hang) until the connection is closed.

Just specify a timeout value, like this:

r = requests.get(
    'http://www.example.com',
    proxies={'http': '222.255.169.74:8080'},
    timeout=5
)

Leave a Comment