Windows参考:https://www.jianshu.com/p/bdfcca29bd34
Linux参考:https://www.jianshu.com/p/9118ffc4a8bb
Windows 第3步代码如下
注意1:第一行修改自己的机器人地址
注意2:json中的url和picurl为同一个,这样点击消息可直接看到图片
$url = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=3e87f7cf"
Invoke-WebRequest $url -Method POST -ContentType "application/json;charset=utf-8" -Body '{
"msgtype": "news",
"news": {
"articles" : [
{
"title" : "中秋节礼品领取",
"description" : "今年中秋节公司有豪礼相送sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss",
"url" : "https://upload-images.jianshu.io/upload_images/10567998-424cbfbc254fd324.png?imageMogr2/auto-orient/strip|imageView2/2/w/1191/format/webp",
"picurl" : "https://upload-images.jianshu.io/upload_images/10567998-424cbfbc254fd324.png?imageMogr2/auto-orient/strip|imageView2/2/w/1191/format/webp"
}
]
}
}'
Linux 第3步代码如下
注意1:第一行修改自己的机器人地址
注意2:json中的url和picurl为同一个,这样点击消息可直接看到图片
curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=3e87ab1bff7cf' \
-H 'Content-Type: application/json' \
-d '{
"msgtype": "news",
"news": {
"articles" : [
{
"title" : "中秋节礼品领取",
"description" : "今年中秋节公司有豪礼相送sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss",
"url" : "https://upload-images.jianshu.io/upload_images/10567998-424cbfbc254fd324.png?imageMogr2/auto-orient/strip|imageView2/2/w/1191/format/webp",
"picurl" : "https://upload-images.jianshu.io/upload_images/10567998-424cbfbc254fd324.png?imageMogr2/auto-orient/strip|imageView2/2/w/1191/format/webp"
}
]
}
}'