java.net.unknownhostexception:api.weixin.qq.com?
URIBuilder uriBuilder = new URIBuilder(“https://api.weixin.qq.com/sns/jscode2session”);
uriBuilder.addParameter(“appid”, appid);
uriBuilder.addParameter(“secret”, secret);
uriBuilder.addParameter(“js_code”, js_code);
uriBuilder.addParameter(“grant_type”, “authorization_code”);
HttpGet httpGet = new HttpGet(uriBuilder.build());
在程序中通过以上代码调用,偶尔会报错:java.net.unknownhostexception:api.weixin.qq.com,手机号获取失败