From b8d1dd86a0d8c4261d4f3765f3ca227d7b555c84 Mon Sep 17 00:00:00 2001 From: Devendra Date: Tue, 25 Mar 2014 10:50:39 +0530 Subject: fixing encryption, and changing from urllib3 to urllib --- python/unassembled/Platform.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'python/unassembled/Platform.py') diff --git a/python/unassembled/Platform.py b/python/unassembled/Platform.py index 627a350..55ec449 100644 --- a/python/unassembled/Platform.py +++ b/python/unassembled/Platform.py @@ -1,4 +1,5 @@ -import urllib3 + +import urllib.request class Pubnub(PubnubCore): def __init__( @@ -20,17 +21,16 @@ class Pubnub(PubnubCore): origin = origin, uuid = pres_uuid ) - self.http = urllib3.PoolManager(timeout=310) def _request( self, request, callback = None ) : ## Build URL url = self.getUrl(request) - + print(url) ## Send Request Expecting JSONP Response try: - response = self.http.request('GET', url) - resp_json = json.loads(response.data.decode("utf-8")) - except: + response = urllib.request.urlopen(url,timeout=310) + resp_json = json.loads(response.read().decode("utf-8")) + except Exception as e: return None if (callback): -- cgit v1.2.3