A taste of urllib3

 1 import urllib3
 2 import certifi
 3 
 4 
 5 http = urllib3.PoolManager(
 6     cert_reqs='CERT_REQUIRED', # Force certificate check.
 7     ca_certs=certifi.where(),  # Path to the Certifi bundle.
 8 )
 9 try:
10     res = http.request('GET', 'https://github.com')
11     print(res.status)
12     print(res.headers)
13 except urllib3.exceptions.SSLError as e:
14     print(e)

My favourite way to express my thoughts or ideas is writing code.

posted on 2016-03-16 11:04  fqzhang  阅读(168)  评论(0编辑  收藏  举报

导航