Skip to content

Instantly share code, notes, and snippets.

@mbacheck
mbacheck / 0_urllib2.py
Created November 25, 2015 02:14 — forked from kennethreitz/0_urllib2.py
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()