调用auth.code2Session返回值报错,怎么解决?
{"errcode":40013,"errmsg":"invalid appid, hints: [ req_id: JGHEu.wgE-ctEZVA ]"} [代码]public[代码] [代码]String do_get(String JSCODE) [代码][代码]throws[代码] [代码]ClientProtocolException, IOException {[代码][代码] [代码][代码]String body = [代码][代码]"{}"[代码][代码];[代码][代码] [代码][代码]String APPID = [代码][代码]"wxbea50118b27deed2"[代码][代码];[代码][代码] [代码][代码]String SECRET = [代码][代码]"916e340c613a39a413076a03d5379692"[代码][代码];[代码][代码]// String JSCODE1 = "021Ktl4S1ognG510zT2S1f7w4S1Ktl4Q";[代码][代码] [代码][代码]DefaultHttpClient httpclient = [代码][代码]new[代码] [代码]DefaultHttpClient();[代码][代码] [代码][代码]try[代码] [代码]{[代码][代码] [代码][代码]HttpGet httpget = [代码][代码]new[代码] [代码]HttpGet([代码][代码]"https://api.weixin.qq.com/sns/jscode2session?appid="[代码][代码]+APPID+[代码][代码]"+&secret="[代码][代码]+SECRET+[代码][代码]"&js_code="[代码][代码]+JSCODE+[代码][代码]"&grant_type=authorization_code"[代码][代码]);[代码][代码] [代码][代码]SSLSocketFactory.getSocketFactory().setHostnameVerifier([代码][代码]new[代码] [代码]AllowAllHostnameVerifier());[代码][代码] [代码][代码]HttpResponse response = httpclient.execute(httpget);[代码][代码] [代码][代码]HttpEntity entity = response.getEntity();[代码][代码] [代码][代码]body = EntityUtils.toString(entity);[代码][代码] [代码][代码]System.out.println(body);[代码][代码] [代码][代码]} [代码][代码]finally[代码] [代码]{[代码][代码] [代码][代码]httpclient.getConnectionManager().shutdown();[代码][代码] [代码][代码]}[代码][代码] [代码][代码]return[代码] [代码]body;[代码][代码] [代码][代码]}[代码]