Last active
August 29, 2015 14:10
-
-
Save erwan/37095082f99ee75ee450 to your computer and use it in GitHub Desktop.
urlib3fail.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import unicode_literals | |
import urllib3 | |
try: # 2.7 | |
import urllib.parse as urlparse | |
except ImportError: # 3.x | |
import urllib as urlparse | |
try: | |
import urllib3.contrib.pyopenssl | |
urllib3.contrib.pyopenssl.inject_into_urllib3() | |
except ImportError: | |
pass | |
http = urllib3.PoolManager() | |
url = "https://lesbonneschoses.prismic.io/api" | |
r = http.request('GET', url) | |
print r.data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment