安装requests模块
import requests
#去互亿http://www.ihuyi.com/
url = ‘http://106.ihuyi.com/webservice/sms.php?method=Submit’
mobile = ‘xxxxxx’ #电话号
account= ‘xxxxx’ #上面的APIID
password = ‘xxxxx’ #为上图的APIKEY
header = {‘Content-type’:‘application/x-www-form urlencoded’,‘Accept’:‘text/plain’}
data = {
‘account’:account,
‘mobile’:mobile,
‘password’:password,
‘content’:‘您的验证码是:1234。请不要把验证码泄露给其他人。’#注意不可更改
}
response = requests.post(url=url,data=data,headers= header)
print(response.content.decode())