Python 官方文档:入门教程 => 点击学习
#!/usr/bin/env python#-- coding: utf8 -- import sysimport requestsimport JSON def sendsms(phone, subject, message):"""发送
#!/usr/bin/env python
#-- coding: utf8 --
import sys
import requests
import JSON
def sendsms(phone, subject, message):
"""
发送短信
"""
values = {"appCode": "ZBXSZ",
"businessType": "tz",
"businessNo": "adf324",
"phoneNums": phone,
"templCode": "bqjrtzZBXSZyzryy73760",
"atTime": "null",
"paramsBody": {
"value0": subject,
"value1": message
}
}
headers = {'Content-Type': 'application/json'}
host = 'aps.bqjr.cn'
post_url = 'Http://' + host + '/bqjr/msg/send'
response = requests.post(url=post_url, headers=headers, data=json.dumps(values))
try:
req= requests.post(url=post_url, data=json.dumps(values))
print req.content
except Exception, e:
print e
if name == 'main':
phone = sys.argv[1]
subject = sys.argv[2]
message = sys.argv[3]
sendsms(phone, subject, message)
--结束END--
本文标题: zabbix--python短信接口脚本
本文链接: https://lsjlt.com/news/184937.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0