~~~ import urllib, urllib2, sys host = 'http://www.api51.cn' path = '/api/smsApi/send' method = 'POST' querys = '' bodys = {} url = host + path bodys['mobile'] = '13288888888' bodys['params'] = '1024,张三' bodys['sign'] = '网极科技' bodys['token'] = 'token' bodys['tpl_id'] = '46792' post_data = urllib.urlencode(bodys) request = urllib2.Request(url, post_data) //根据API的要求,定义相对应的Content-Type request.add_header('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8') response = urllib2.urlopen(request) content = response.read() if (content): print(content) ~~~