收藏
回答

企业微信群机器人在windows下发消息失败Warning: wrong json format?

同一条命令,在Linux下是成功的:

root@wudan:/home/wudan# curl -H 'Content-Type: application/json' -d '{"msgtype":"text","text":{"content":"IP is 100.1.1.7"}}' https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxx

{"errcode":0,"errmsg":"ok"}root@wudan:/home/wudan#

但是在Windows下就发送失败,提示json错误:

C:\Users\45409>curl -H 'Content-Type: application/json' -d '{"msgtype":"text","text":{"content":"IP is 100.1.1.7"}}' https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxx

curl: (6) Could not resolve host: application

{"errcode":40008,"errmsg":"Warning: wrong json format. invalid message type, hint: [1636501875_160_30dc0d3d0428d5540682ab25145ad6bd], from ip: 220.200.59.109, more info at https://open.work.weixin.qq.com/devtool/query?e=40008"}


回答关注问题邀请回答
收藏

2 个回答

  • 企业微信运营专员-千夜
    企业微信运营专员-千夜
    2021-11-11

    你好,windows下已经报错了 Could not resolve host: application 无法解析主机吧

    2021-11-11
    有用
    回复 2
    • 吴丹
      吴丹
      2021-11-13
      如果无法解析的话,就不会有errcode这些response消息了吧
      2021-11-13
      回复
    • 吴丹
      吴丹
      2021-11-13
      实际也可以ping通域名
      C:\>ping qyapi.weixin.qq.com
      正在 Ping qyapi.weixin.qq.com [157.255.173.237] 具有 32 字节的数据:
      来自 157.255.173.237 的回复: 字节=32 时间=25ms TTL=54
      来自 157.255.173.237 的回复: 字节=32 时间=26ms TTL=54
      来自 157.255.173.237 的回复: 字节=32 时间=25ms TTL=54
      来自 157.255.173.237 的回复: 字节=32 时间=32ms TTL=54
      157.255.173.237 的 Ping 统计信息:
          数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
      往返行程的估计时间(以毫秒为单位):
          最短 = 25ms,最长 = 32ms,平均 = 27ms
      2021-11-13
      回复
  • -
    -
    2023-04-08

    请问问题解决了 如何解决的 我现在也遇到这个问题了


    2023-04-08
    有用
    回复
登录 后发表内容