Skip to content

Commit c48972e

Browse files
committed
use StandardCharsets.UTF_8 to replace the deprecated HTTP.UTF_8
1 parent 1364b6e commit c48972e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/github/service/impl/CoreServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.github.service.impl;
22

33
import java.io.IOException;
4+
import java.nio.charset.StandardCharsets;
45
import java.util.List;
56

67
import javax.annotation.PostConstruct;
@@ -15,7 +16,6 @@
1516
import org.apache.http.client.methods.HttpPost;
1617
import org.apache.http.impl.client.CloseableHttpClient;
1718
import org.apache.http.impl.client.HttpClientBuilder;
18-
import org.apache.http.protocol.HTTP;
1919
import org.apache.http.util.EntityUtils;
2020
import org.slf4j.Logger;
2121
import org.slf4j.LoggerFactory;
@@ -85,7 +85,7 @@ public void requestPost(String url, List<NameValuePair> params) throws ClientPro
8585
CloseableHttpClient httpclient = HttpClientBuilder.create().build();
8686

8787
HttpPost httppost = new HttpPost(url);
88-
httppost.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
88+
httppost.setEntity(new UrlEncodedFormEntity(params, StandardCharsets.UTF_8));
8989

9090
CloseableHttpResponse response = httpclient.execute(httppost);
9191
System.out.println(response.toString());

0 commit comments

Comments
 (0)