1. 程式人生 > 其它 >如何往微信上推送訊息

如何往微信上推送訊息

技術標籤:微信

這裡使用一個具備推送功能的公眾號來實現

  1. 登入及時達推送官網
  2. 新建一個通道如圖
    在這裡插入圖片描述
  3. 編寫python程式碼
import requests
# 推送功能
    msg_key = "3991*******************"
    url = "http://push.ijingniu.cn/send"

    data = {
        "key": msg_key,
        "head": "This is a head",
        "body"
: "This is a body" } res = requests.post(url=url, data=data) print(res.text)