微信获得access-token

微信获得access-token

        RestTemplate template = new RestTemplate();
        String appid =  "aa";
        String secret = "bb";
        String tokenUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+appid+"&secret="+secret;
        @SuppressWarnings("rawtypes")
        Map map = template.getForObject(tokenUrl, Map.class);
        Object obj1 =  map.get("access_token");
        if(obj1 == null){ // access_token ERROR!
            return "";
        }
        String accessToken = (String) obj1;

 

微信获得access-token

上一篇:微信被动回复用户消息-文本消息-填坑


下一篇:微信自定义菜单