Commits

Peter Miron  committed 2d19074

patched to work with requests 1.0.4

  • Participants
  • Parent commits 45dc651

Comments (0)

Files changed (2)

 
 Trollop is a Python library for working with the `Trello API`_.
 
+Depends On:
+
+`Requests 1.0.4`_
+
 Quick Start
 ===========
 
 .. _API key: https://trello.com/card/board/generating-your-developer-key/4ed7e27fe6abb2517a21383d/4eea75831576578f2713f460
 .. _oauth token: https://trello.com/card/board/getting-a-user-token-and-oauth-urls/4ed7e27fe6abb2517a21383d/4eea75bc1576578f2713fc5f 
 .. _MIT License: http://www.opensource.org/licenses/mit-license.php
+.. _Requests 1.0.4: http://docs.python-requests.org/en/latest/

File trollop/lib.py

 class TrelloConnection(object):
 
     def __init__(self, api_key, oauth_token):
-        self.session = requests.session(
-            headers={'Accept': 'application/json',
-                     'Content-Type': 'application/json'})
+        self.session = requests.session()
+
+        self.headers={'Accept': 'application/json',
+                'Content-Type': 'application/json'}
         self.key = api_key
         self.token = oauth_token
 
         params = params or {}
         params.update({'key': self.key, 'token': self.token})
         url += '?' + urlencode(params)
-        response = self.session.request(method, url, data=body)
+        response = self.session.request(method, url, data=body, headers=self.headers)
         if response.status_code != 200:
             # TODO: confirm that Trello never returns a 201, for example, when
             # creating a new object. If it does, then we shouldn't restrict