@@ -65,7 +65,7 @@ public byte[] postForBytes(String url, String requestStr, boolean useKey) throws
6565 httpPost .releaseConnection ();
6666 }
6767 } catch (Exception e ) {
68- this .logError ( url , requestStr , e );
68+ this .logError (url , requestStr , e );
6969 wxApiData .set (new WxPayApiData (url , requestStr , null , e .getMessage ()));
7070 throw new WxPayException (e .getMessage (), e );
7171 }
@@ -170,8 +170,6 @@ public String postV3WithWechatpaySerial(String url, String requestStr) throws Wx
170170
171171 @ Override
172172 public String postV3 (String url , HttpPost httpPost ) throws WxPayException {
173- String serialNumber = getWechatPaySerial (getConfig ());
174- httpPost .addHeader (WECHAT_PAY_SERIAL , serialNumber );
175173 return this .requestV3 (url , httpPost );
176174 }
177175
@@ -264,8 +262,11 @@ public String deleteV3(String url) throws WxPayException {
264262
265263 private void configureRequest (HttpRequestBase request ) {
266264 String serialNumber = getWechatPaySerial (getConfig ());
265+ String method = request .getMethod ();
267266 request .addHeader (ACCEPT , APPLICATION_JSON );
268- request .addHeader (CONTENT_TYPE , APPLICATION_JSON );
267+ if (!method .equals ("POST" )) {
268+ request .addHeader (CONTENT_TYPE , APPLICATION_JSON );
269+ }
269270 request .addHeader (WECHAT_PAY_SERIAL , serialNumber );
270271
271272 request .setConfig (RequestConfig .custom ()
0 commit comments