diff --git a/CHANGES.md b/CHANGES.md index 0369610..ff296e5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,11 @@ Changelog Here you find a full list of changes. +Version 2.0.1 +------------- + +- Reuse HTTP connections between requests + Version 2.0.0 ------------- diff --git a/setup.py b/setup.py index 29945b0..abc3b90 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ except ImportError: from distutils.core import setup -VERSION = '2.0.0' +VERSION = '2.0.1' setup( name='usabilla-api', diff --git a/usabilla.py b/usabilla.py index 31a5ba4..3632ef6 100644 --- a/usabilla.py +++ b/usabilla.py @@ -127,6 +127,8 @@ class APIClient(object): host = 'data.usabilla.com' host_protocol = 'https://' + session = requests.Session() + def __init__(self, client_key, secret_key): """Initialize an APIClient object.""" self.query_parameters = '' @@ -237,7 +239,7 @@ def send_signed_request(self, scope): # Send the request. request_url = self.host + scope + '?' + canonical_querystring - r = requests.get(self.host_protocol + request_url, headers=headers) + r = self.session.get(self.host_protocol + request_url, headers=headers) r.raise_for_status() return r.json()