<>
@RequestMapping("/sendPostToRoot")
@ResponseBody
public String qwRoot() {
//推送消息到企业邮箱的机器人。
JSONObject j=new JSONObject();
j.put("msgtype", "text");
JSONObject j1=new JSONObject();
j1.put("content","本地项目推送信息");
j1.put("mentioned_list","["@all"]");
j.put("text", j1);
System.out.println(j.toString());
HttpClientUtil h=new HttpClientUtil();
String s=h.doPost("https://qyapi.weixin.qq.com/", j);
return s;
}![](https://img-blog.csdnimg.cn/20200703180022420.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xpYW5nZGluZ2d1bw==,size_16,color_FFFFFF,t_70)
![](https://img-blog.csdnimg.cn/20200702170506233.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xpYW5nZGluZ2d1bw==,size_16,color_FFFFFF,t_70)
上述doPost方法再我博客Java分栏的项目下面有源码,