码迷,mamicode.com
首页 > 微信 > 详细

微信获取二维码

时间:2017-03-22 00:20:55      阅读:313      评论:0      收藏:0      [点我收藏+]

标签:creat   .com   new   create   warning   二维   ticket   cti   cgi   

微信获取二维码

String listUrl = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token="+accessToken;
        // {"action_name": "QR_LIMIT_STR_SCENE", "action_info": {"scene": {"scene_str": "123"}}}
        Map<String, Object> request = new HashMap<String, Object>();
        request.put("action_name", "QR_LIMIT_STR_SCENE");
        Map<String, Object> actionInfoMap = new HashMap<String, Object>();
        Map<String, String> sceneMap = new HashMap<String, String>();
        sceneMap.put("scene_str", qrid);
        actionInfoMap.put("scene", sceneMap);
        request.put("action_info", actionInfoMap);
        @SuppressWarnings("unchecked")
        Map<String,String> postMap = template.postForObject(listUrl, request, Map.class);
        if(postMap == null){
            return "";
        }
        String url = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=";
        return url + postMap.get("ticket");

 

微信获取二维码

标签:creat   .com   new   create   warning   二维   ticket   cti   cgi   

原文地址:http://www.cnblogs.com/stono/p/6597504.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!