From 3c001cbb096a22c468bb15cbd8cc1007fb66e45d Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 24 Aug 2022 14:15:13 +0800 Subject: [PATCH] // test --- .../service/impl/WxPayServiceApacheHttpImpl.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java index 7ec9039c..c0534b8f 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java @@ -252,13 +252,14 @@ public class WxPayServiceApacheHttpImpl extends BaseWxPayServiceImpl { } private StringEntity createEntry(String requestStr) { - try { - return new StringEntity(new String(requestStr.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1)); - } catch (UnsupportedEncodingException e) { - //cannot happen - this.log.error(e.getMessage(), e); - return null; - } + return new StringEntity(requestStr, ContentType.create("application/json", "utf-8")); +// try { +// return new StringEntity(new String(requestStr.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1)); +// } catch (UnsupportedEncodingException e) { +// //cannot happen +// this.log.error(e.getMessage(), e); +// return null; +// } } private HttpClientBuilder createHttpClientBuilder(boolean useKey) throws WxPayException {