Skip to content

Instantly share code, notes, and snippets.

@kunpengku
Created July 14, 2014 05:51
Show Gist options
  • Save kunpengku/b0b8c21bf8925a259680 to your computer and use it in GitHub Desktop.
Save kunpengku/b0b8c21bf8925a259680 to your computer and use it in GitHub Desktop.
python post数据。
#!/usr/local/bin/python
import urllib
import urllib2
url = 'http://10.10.0.3:8080/openapi/client/downloadPlanid'
values = {'oauth_id':'lang', 'password':'123456'}
param = urllib.urlencode(values)
req = urllib2.Request(url, param)
response = urllib2.urlopen(req)
the_page = response.read()
print the_page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment