From 474f5aba485f33335b87ad47b500955a3b40986b Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Wed, 31 Oct 2012 11:33:42 -0400 Subject: [PATCH] Added hack for the response type not being set --- python_apps/api_clients/api_client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python_apps/api_clients/api_client.py b/python_apps/api_clients/api_client.py index 1229912a3..9c23ab45e 100644 --- a/python_apps/api_clients/api_client.py +++ b/python_apps/api_clients/api_client.py @@ -83,7 +83,10 @@ class ApiRequest(object): if _post_data is not None: _post_data = urllib.urlencode(_post_data) req = urllib2.Request(final_url, _post_data) response = urllib2.urlopen(req).read() - return json.loads(response) + # Ghetto hack for now because we don't the content type we are getting + # (Pointless to look at mime since it's not being set correctly always) + try: return json.loads(response) + except ValueError: return response class RequestProvider(object): """ Creates the available ApiRequest instance that can be read from