def client_post_formurlencodeddata_requests(request_url,requestJSONdata):
#功能说明:发送以form表单数据格式(它要求数据名称(name)和数据值(value)之间以等号相连,与另一组name/value值之间用&相连。例如:parameter1=12345¶meter2=23456。)请求到远程服务器,并获取请求响应报文。该请求消息头要求为:{"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}。
#输入参数说明:接收请求的URL;请求报文数据,格式为name1=value1&name2=value2
#输出参数:请求响应报文
import requests

requestJSONdata=str(requestJSONdata).replace("+", "%2B")
requestdata=requestJSONdata.encode("utf-8")
head = {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", 'Connection': 'close'}

print '客户端请求JSON报文数据为(客户端 --> 服务端):\n',requestdata

#客户端发送请求报文到服务端
r = requests.post(request_url,data=requestdata,headers=head)

#客户端获取服务端的响应报文数据
responsedata=r.text
print '服务端的响应报文为(客户端 <--服务端): ',responsedata
print "get the status: ",r.status_code

#返回请求响应报文
return responsedata