Skip to content

Commit 91e86df

Browse files
author
Laurynas Butkus
committed
Set default timeout
1 parent a0b2d3b commit 91e86df

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

convertapi/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ def __init__(self, configuration):
77
self.configuration = configuration
88

99
def get(self, path, params = {}, timeout = None):
10+
timeout = timeout or self.configuration.timeout
1011
r = requests.get(self.url(path), params = params, headers = self.headers(), timeout = timeout)
1112
return self.handle_response(r)
1213

1314
def post(self, path, payload, timeout = None):
15+
timeout = timeout or self.configuration.timeout
1416
r = requests.post(self.url(path), data = payload, headers = self.headers(), timeout = timeout)
1517
return self.handle_response(r)
1618

0 commit comments

Comments
 (0)