Skip to content

Commit 9b6c4ff

Browse files
ContentType改为更为精确的写法
1 parent 6130998 commit 9b6c4ff

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/main/java/com/wechat/pay/contrib/apache/httpclient/WechatPayUploadHttpPost.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public WechatPayUploadHttpPost build() {
6969
.addTextBody("meta", meta, APPLICATION_JSON);
7070

7171
request.setEntity(entityBuilder.build());
72-
request.addHeader(ACCEPT, APPLICATION_JSON.getMimeType());
72+
request.addHeader(ACCEPT, APPLICATION_JSON.toString());
7373

7474
return request;
7575
}

src/main/java/com/wechat/pay/contrib/apache/httpclient/auth/AutoUpdateCertificatesVerifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected void autoUpdateCert() throws IOException, GeneralSecurityException {
101101
.build()) {
102102

103103
HttpGet httpGet = new HttpGet(CERT_DOWNLOAD_PATH);
104-
httpGet.addHeader(ACCEPT, APPLICATION_JSON.getMimeType());
104+
httpGet.addHeader(ACCEPT, APPLICATION_JSON.toString());
105105

106106
try (CloseableHttpResponse response = httpClient.execute(httpGet)) {
107107
int statusCode = response.getStatusLine().getStatusCode();

src/test/java/com/wechat/pay/contrib/apache/httpclient/AutoUpdateVerifierTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void autoUpdateVerifierTest() {
7373
public void getCertificateTest() throws Exception {
7474
URIBuilder uriBuilder = new URIBuilder("https://api.mch.weixin.qq.com/v3/certificates");
7575
HttpGet httpGet = new HttpGet(uriBuilder.build());
76-
httpGet.addHeader(ACCEPT, APPLICATION_JSON.getMimeType());
76+
httpGet.addHeader(ACCEPT, APPLICATION_JSON.toString());
7777
CloseableHttpResponse response = httpClient.execute(httpGet);
7878
assertEquals(SC_OK, response.getStatusLine().getStatusCode());
7979
try {

src/test/java/com/wechat/pay/contrib/apache/httpclient/HttpClientBuilderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ protected void doSend(HttpUriRequest request, HttpEntity entity, Consumer<Closea
116116
if (entity != null && request instanceof HttpPost) {
117117
((HttpPost) request).setEntity(entity);
118118
}
119-
request.addHeader(ACCEPT, APPLICATION_JSON.getMimeType());
119+
request.addHeader(ACCEPT, APPLICATION_JSON.toString());
120120

121121
try (CloseableHttpResponse response = httpClient.execute(request)) {
122122
responseCallback.accept(response);

src/test/java/com/wechat/pay/contrib/apache/httpclient/RsaCryptoTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void postEncryptDataTest() throws Exception {
8585
+ "}";
8686
StringEntity reqEntity = new StringEntity(data, APPLICATION_JSON);
8787
httpPost.setEntity(reqEntity);
88-
httpPost.addHeader(ACCEPT, APPLICATION_JSON.getMimeType());
88+
httpPost.addHeader(ACCEPT, APPLICATION_JSON.toString());
8989
httpPost.addHeader(WECHAT_PAY_SERIAL, wechatPaySerial);
9090

9191
CloseableHttpResponse response = httpClient.execute(httpPost);

0 commit comments

Comments
 (0)