Advertisement
gauravssnl

urllib2_headers_dict

Sep 29th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. # urllib2_headers_dict
  2. import urllib2,httplib
  3. url="http://cmyip.com"
  4. request=urllib2.Request(url)
  5. opener=urllib2.build_opener()
  6. datastream=opener.open(request)
  7. print repr(datastream.headers.__dict__)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement