1,客户要求用户在点击某个按钮触发一个客服发送文本的要求,(原先发图片没遇到乱码的问题)结果一发一乱码。。。效果如下                    python 解决微信客服接口发送文本消息中文乱码的问题

2 更改代码如下

    url='https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=%s'%abcer['token']
    datas={
    "touser":user.openid,
    "msgtype":"text",
    "text":{"content":"您好,请点击下方的“在线客服”按钮开始咨询哦~"}
    }
    data = json.dumps(datas, ensure_ascii=False).encode('utf-8')
    r=requests.post(url,data=data)

3,改完效果如下

python 解决微信客服接口发送文本消息中文乱码的问题

相关文章:

  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2021-04-29
  • 2021-08-31
  • 2021-12-12
  • 2021-12-13
  • 2021-10-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-06
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
相关资源
相似解决方案