java 发送微信公众号消息

				//发送微信公众号消息
		        String message =" {\"msgtype\":\"text\",\"text\":{\"content\":\"确认衣服定制流程!请点击\"},\"touser\":\"oTdslt4FJsR1AFyZH0axyyHD1xZU\"}";
		        String accessTokenUrl = "http://www.menggu100.com/test002.php";
		        try {
		            String jsonStr = HttpClientUtils.sendPost(accessTokenUrl);
		            JSONObject jsonToken = JSONObject.fromObject(jsonStr);
					String accessToken = jsonToken.getString("access_token");
		            System.out.println(accessToken);
		            String postUrl = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" + accessToken;
		            String res = HttpClientUtils.sendPostJsonStr(postUrl, message);
		            System.out.println(res);
		        } catch (IOException e) {
		            e.printStackTrace();
		        }

你可能感兴趣的:(java,微信,开发语言)