Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

urllib.request.urlopen with headers

try:
    from urllib.request import Request, urlopen  # Python 3
except ImportError:
    from urllib2 import Request, urlopen  # Python 2

req = Request(url)
req.add_header('apikey', 'xxx')
response = urlopen(req)
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #headers
ADD COMMENT
Topic
Name
9+1 =