Skip to content

Instantly share code, notes, and snippets.

@erwan
Last active August 29, 2015 14:10
Show Gist options
  • Save erwan/37095082f99ee75ee450 to your computer and use it in GitHub Desktop.
Save erwan/37095082f99ee75ee450 to your computer and use it in GitHub Desktop.
urlib3fail.py
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