Python + html5 + push - 消息推送

**感谢各位前辈的分享,这里总结一下:
此方法是使用通过pushplus向微信发送短信
**

https://pushplus.hxtrip.com/login?redirectUrl=/message2

# coding:utf-8
import requests
import json
def Send_Message(titles, content):		#  标题 ,内容
    headers = {
        "User-Agent": "Mozilla/5.0 (Linux; Android 9; SM-A102U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.93 Mobile Safari/537.36",
        'Content-Type': 'application/json'
    }
    # pushplus接口
    url = 'http://pushplus.hxtrip.com/send'
    data = {
            'token': '664b14fe8b7345c2926d607757186e0b',        # 登录https://pushplus.hxtrip.com/login?redirectUrl=/message2扫码后获取的token值。
            'title': titles,
            'content': content,
            'template': 'html'
            }
    return requests.post(headers=headers, url=url, data=json.dumps(data), timeout=10)

直接调用

Send_Message("", "")
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值