有个python/urllib2/ target=_blank class=infotextkey>python urllib2模块写来做测试HTTP的小脚本,分享给大家。
import urllib import urllib2 import httplib from random import Random data = { 'v' : '1.02', 'action' : 'dev'} data["i"] = 'afafaf' data["c"] = 'afafgkag' f = urllib2.urlopen( url = 'http://192.168.1.88/index.php', data = urllib.urlencode(data) ) print f.read()