Repository: laterpay/laterpay-client-python

Issue:
python-requests requires string only headers
As of python-requests 2.11 headers that are neither string not bytes are not accepted anymore. See kennethreitz/requests#3477

Discussion:
coveralls: 
[![Coverage Status](https://coveralls.io/builds/7544833/badge)](https://coveralls.io/builds/7544833)

Coverage decreased (-0.8%) to 95.984% when pulling **77d70e7cc4f9e64280da7b9ea47521632be54062 on bugfix/requests-string-headers** into **3744237922be5c422568b701a6bf930418581be8 on develop**.


Patch:
diff --git a/laterpay/__init__.py b/laterpay/__init__.py
index c92f556..f2df4a4 100644
--- a/laterpay/__init__.py
+++ b/laterpay/__init__.py
@@ -421,10 +421,7 @@ class LaterPayClient(object):
         """
         params = self._sign_and_encode(params=params, url=url, method=method)
 
-        headers = {
-            'X-LP-APIVersion': 2,
-            'User-Agent': 'LaterPay Client - Python - v0.2'
-        }
+        headers = self.get_request_headers()
 
         if method == 'POST':
             req = Request(url, data=params, headers=headers)
@@ -503,7 +500,7 @@ class LaterPayClient(object):
         Return a ``dict`` of request headers to be sent to the API.
         """
         return {
-            'X-LP-APIVersion': 2,
+            'X-LP-APIVersion': '2',
             # TODO: Add client version information.
             'User-Agent': 'LaterPay Client Python',
         }


Test patch:
diff --git a/tests/test_client.py b/tests/test_client.py
index e6ebc1c..f3069e7 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -302,7 +302,7 @@ class TestLaterPayClient(unittest.TestCase):
 
         call = responses.calls[0]
 
-        self.assertEqual(call.request.headers['X-LP-APIVersion'], 2)
+        self.assertEqual(call.request.headers['X-LP-APIVersion'], '2')
 
         qd = parse_qs(urlparse(call.request.url).query)