python如何接收前臺發(fā)送的請求?
import urllib2 import urllib #定義一個要提交的數(shù)據(jù)數(shù)組(字典) data = {} data['username'] = 'zgx030030' data['password'] = '123456' #定義post的地址 url = ' test.com/post/' post_data = urllib.urlencode(data) #提交,發(fā)送數(shù)據(jù) req = urllib2.urlopen(url, post_data) #獲取提交后返回的信息 content = req.read()