python接收post數(shù)據(jù) 如何用python寫后臺接收客戶端發(fā)送的post請求?
如何用python寫后臺接收客戶端發(fā)送的post請求?Import urllib2import urllib#定義要提交的數(shù)據(jù)數(shù)組(字典)。Data={}Data[“username”]=“zgx03
如何用python寫后臺接收客戶端發(fā)送的post請求?
Import urllib2import urllib#定義要提交的數(shù)據(jù)數(shù)組(字典)。Data={}Data[“username”]=“zgx030030”Data[“password”]=“123456”#定義郵寄地址。Url=“test.com/post/“發(fā)布數(shù)據(jù)=urllib.urlencode文件(數(shù)據(jù))#提交,發(fā)送數(shù)據(jù)請求=urllib2。Urlopen(URL,post)35; Data)#獲取提交后返回的信息內(nèi)容=請求讀取()