利用python进行企业微信机器人自动发送消息

def test_004_robot(self):
   headers = {"Content-Type": "text/plain"}
   s="卖品,打印码:{},验证码{}".format({str(printCode)},{str(verifyCode)})
   data = {
      "msgtype": "text",
      "text": {
         "content": s,
      }
   }
   r = requests.post(
      url='https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=d7786b44-84d3-400a-a018-999999999999',
      headers=headers, json=data)
   print(r.text)

猜你喜欢

转载自blog.csdn.net/qq_43422918/article/details/92798409