This commit is contained in:
jinyu
2016-04-23 12:20:17 +08:00
parent 047ee5f5e1
commit a820a8855f
5 changed files with 24 additions and 7 deletions
@@ -255,6 +255,8 @@ public class MediaApi extends MpApi {
}
HttpParams params = weixinExecutor.getExecuteParams();
request.setParams(params);
logger.info("weixin request >> " + request.getMethod() + " "
+ request.getURI().toString());
HttpResponse response = weixinExecutor.getExecuteClient().execute(
request);
byte[] content = IOUtil.toByteArray(response.getBody());
@@ -262,8 +264,12 @@ public class MediaApi extends MpApi {
String contentType = headers.getFirst(HttpHeaders.CONTENT_TYPE);
String disposition = headers
.getFirst(HttpHeaders.CONTENT_DISPOSITION);
if (contentType
.contains(ContentType.APPLICATION_JSON.getMimeType())
logger.info("weixin response << " + response.getProtocol()
+ response.getStatus().toString() + "[" + contentType + "]->"
+ disposition);
if (contentType.contains(ContentType.TEXT_PLAIN.getMimeType())
|| contentType.contains(ContentType.APPLICATION_JSON
.getMimeType())
|| (disposition != null && disposition.indexOf(".json") > 0)) {
JsonResult jsonResult = JSON.parseObject(content, 0,
content.length, Consts.UTF_8.newDecoder(),