Guest User

Untitled

a guest
Jul 14th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import urllib, json
  2. response = urllib.urlopen("http://reddit.com/.json")
  3. content = response.read()
  4. data = json.loads(content)
  5.  
  6. import urllib.request, json
  7. response = urllib.request.urlopen("http://reddit.com/.json")
  8. content = response.read()
  9. data = json.loads(content)
  10.  
  11. import urllib.request, json
  12. response = urllib.request.urlopen("http://reddit.com/.json")
  13. content = response.read()
  14. data = json.loads(content.decode("utf8"))
  15.  
  16. >>> response.headers['content-type']
  17. 'application/json; charset=UTF-8'
Add Comment
Please, Sign In to add comment