diff --git a/setup.py b/setup.py index 8831d0b..3f1ed89 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages import sys -install_requires = ["requests"] +install_requires = ["requests>=1.0"] if sys.version_info < (2, 6): install_requires.append("simplejson") diff --git a/slumber/__init__.py b/slumber/__init__.py index 5896ef0..14deaa3 100644 --- a/slumber/__init__.py +++ b/slumber/__init__.py @@ -120,9 +120,11 @@ def _try_to_serialize_response(self, resp): try: stype = s.get_serializer(content_type=content_type) except exceptions.SerializerNotAvailable: + stype = s.get_serializer() + try: + return stype.loads(resp.content) + except: return resp.content - - return stype.loads(resp.content) else: return resp.content