公众号发消息 获取稳定版token,post json请求
报40125 ,
通过rid 查传参格式
secret 数据为******** 什么原因呢
request_body: "{"grant_type":"client_credential","appid":"正常","secret":"********"}"
代码如下
//代理服务器转发
HttpHost proxy = new HttpHost("****");
//请求url
HttpPost httpPost = new HttpPost(url);
httpPost.setConfig(RequestConfig.custom().setProxy(proxy).build());
httpPost.setHeader("Content-type", "application/json");
//json 数据
String json = String.format("{\"grant_type\":\"client_credential\",\"appid\":\"%s\",\"secret\":\"%s\"}", appid, appsecret);
httpPost.setEntity(new StringEntity(json));
try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
String body = EntityUtils.toString(response.getEntity(), "UTF-8");
return extractAccessTokenByBody(body);
}
请问 什么原因呢?
secret核对过,正确,为什么报40125