Visitar URL original
修复POST请求签名错误问题 by SynchPj · Pull Request #3586 · binarywang/WxJava · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🎨 恢复代码,解决连接池异常
  • Loading branch information
SynchPj
SynchPj committed May 13, 2025
commit 78273a3468c570125c55ee1fa2f911925b219626
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public String postV3(String url, String requestStr) throws WxPayException {
}

private String requestV3(String url, String requestStr, HttpRequestBase httpRequestBase) throws WxPayException {
try (CloseableHttpClient httpClient = this.createApiV3HttpClient();
CloseableHttpResponse response = httpClient.execute(httpRequestBase)) {
CloseableHttpClient httpClient = this.createApiV3HttpClient();
try (CloseableHttpResponse response = httpClient.execute(httpRequestBase)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
//post方法有可能会没有返回值的情况
Expand Down Expand Up @@ -142,8 +142,8 @@ public String patchV3(String url, String requestStr) throws WxPayException {
public String postV3WithWechatpaySerial(String url, String requestStr) throws WxPayException {
HttpPost httpPost = this.createHttpPost(url, requestStr);
this.configureRequest(httpPost);
try (CloseableHttpClient httpClient = this.createApiV3HttpClient();
CloseableHttpResponse response = httpClient.execute(httpPost)) {
CloseableHttpClient httpClient = this.createApiV3HttpClient();
try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
String responseString = "{}";
Expand Down Expand Up @@ -178,9 +178,8 @@ public String postV3(String url, HttpPost httpPost) throws WxPayException {
@Override
public String requestV3(String url, HttpRequestBase httpRequest) throws WxPayException {
this.configureRequest(httpRequest);

try (CloseableHttpClient httpClient = this.createApiV3HttpClient();
CloseableHttpResponse response = httpClient.execute(httpRequest)) {
CloseableHttpClient httpClient = this.createApiV3HttpClient();
try (CloseableHttpResponse response = httpClient.execute(httpRequest)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
//post方法有可能会没有返回值的情况
Expand Down Expand Up @@ -223,11 +222,9 @@ public String getV3WithWechatPaySerial(String url) throws WxPayException {
@Override
public InputStream downloadV3(String url) throws WxPayException {
HttpGet httpGet = new WxPayV3DownloadHttpGet(url);
httpGet.addHeader(ACCEPT, ContentType.WILDCARD.getMimeType());
String serialNumber = getWechatPaySerial(getConfig());
httpGet.addHeader(WECHAT_PAY_SERIAL, serialNumber);
try (CloseableHttpClient httpClient = this.createApiV3HttpClient();
CloseableHttpResponse response = httpClient.execute(httpGet)) {
this.configureRequest(httpGet);
CloseableHttpClient httpClient = this.createApiV3HttpClient();
try (CloseableHttpResponse response = httpClient.execute(httpGet)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
Header contentType = response.getFirstHeader(HttpHeaders.CONTENT_TYPE);
Expand Down