Skip to content

Commit

Permalink
use StandardCharsets.UTF_8 to replace the deprecated HTTP.UTF_8
Browse files Browse the repository at this point in the history
  • Loading branch information
binarywang committed Oct 1, 2016
1 parent 1364b6e commit c48972e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/github/service/impl/CoreServiceImpl.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.service.impl;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;

import javax.annotation.PostConstruct;
Expand All @@ -15,7 +16,6 @@
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -85,7 +85,7 @@ public void requestPost(String url, List<NameValuePair> params) throws ClientPro
CloseableHttpClient httpclient = HttpClientBuilder.create().build();

HttpPost httppost = new HttpPost(url);
httppost.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
httppost.setEntity(new UrlEncodedFormEntity(params, StandardCharsets.UTF_8));

CloseableHttpResponse response = httpclient.execute(httppost);
System.out.println(response.toString());
Expand Down

0 comments on commit c48972e

Please sign in to comment.