java - 通过微信小程序平台提供的接口 访问日活数据 date format错误?
本文介绍了java - 通过微信小程序平台提供的接口 访问日活数据 date format错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
https://api.weixin.qq.com/dat...
POST 内容示例:
{
"begin_date" : "20170313",
"end_date" : "20170313"
}
CloseableHttpClient httpClient = createSSLClientDefault();
HttpPost httpPost = new HttpPost();
httpPost.setURI(new URI(url));
httpPost.setEntity(new UrlEncodedFormEntity(nvps));
CloseableHttpResponse response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
if (entity != null) {
String result = EntityUtils.toString(entity, "UTF-8");
System.out.println("Response content: " + result);
return result;
}
Response content: {"errcode":61500,"errmsg":"date format error hint: [Dy5YZa0787e541]"}
解决方案
httpPost.setEntity(new StringEntity(params.toString(), "UTF-8"));
这篇关于java - 通过微信小程序平台提供的接口 访问日活数据 date format错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文