Created
March 25, 2011 08:44
-
-
Save hanksudo/886556 to your computer and use it in GitHub Desktop.
urllib POST data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2, urllib | |
base_url = 'http://login.domain.com' | |
params = {'username':'hank', | |
'password':'hank', | |
} | |
data = urllib.urlencode(params) | |
req = urllib2.Request(base_url, data) | |
response = urllib2.urlopen(req) | |
print response.read() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment