diff --git a/tests/test_core.py b/tests/test_core.py index c7cf2a2..5673094 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -209,6 +209,9 @@ class TwythonAPITestCase(unittest.TestCase): self.register_response(responses.GET, url, body='{"id": 210462857140252672}') data = self.api.request(endpoint, params={'id': 210462857140252672}) + + if 'headers' in data: + del data['headers'] self.assertEqual({'id': 210462857140252672}, data) diff --git a/twython/api.py b/twython/api.py index f806cea..d4e48cb 100644 --- a/twython/api.py +++ b/twython/api.py @@ -202,6 +202,7 @@ class Twython(EndpointsMixin, object): raise TwythonError('Response was not valid JSON. \ Unable to decode.') + content['headers']=dict(response.headers) return content def _get_error_message(self, response):