收藏
回答

微信公众号发送消息,报40125

公众号发消息 获取稳定版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);
}



请问 什么原因呢?

回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容