diff options
| author | Devendra | 2014-03-25 10:50:39 +0530 |
|---|---|---|
| committer | Devendra | 2014-03-25 10:50:39 +0530 |
| commit | b8d1dd86a0d8c4261d4f3765f3ca227d7b555c84 (patch) | |
| tree | d5cd2e092f44ff36e739fd029afc7b028c8c087f /python/unassembled/Platform.py | |
| parent | 80edcffbfe140a6d19c65deca24e1ba1c0f49b99 (diff) | |
| download | pubnub-python-b8d1dd86a0d8c4261d4f3765f3ca227d7b555c84.tar.bz2 | |
fixing encryption, and changing from urllib3 to urllib
Diffstat (limited to 'python/unassembled/Platform.py')
| -rw-r--r-- | python/unassembled/Platform.py | 12 |
1 files changed, 6 insertions, 6 deletions
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): |
