Advertisement
gauravssnl

test Last-Modified.py

Sep 29th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. # test Last-Modified.py
  2. import urllib2,httplib
  3. url="http://cmyip.com"
  4. request=urllib2.Request(url)
  5. opener=urllib2.build_opener()
  6. firstdatastream=opener.open(request)
  7. print repr(firstdatastream.headers.__dict__)
  8. request.add_header("If-Modified-Since",
  9. firstdatastream.headers.get("Last-Modified"))
  10. seconddatastream=opener.open(request)
  11. print repr(seconddatastream.headers.__dict__)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement