|
|
|
@@ -10,6 +10,7 @@ import org.apache.http.client.methods.CloseableHttpResponse; |
|
|
|
import org.apache.http.client.methods.HttpGet; |
|
|
|
import org.apache.http.client.methods.HttpPost; |
|
|
|
import org.apache.http.client.methods.HttpRequestBase; |
|
|
|
import org.apache.http.entity.ContentType; |
|
|
|
import org.apache.http.entity.StringEntity; |
|
|
|
import org.apache.http.impl.client.CloseableHttpClient; |
|
|
|
import org.apache.http.util.EntityUtils; |
|
|
|
@@ -119,13 +120,14 @@ public class TtPayServiceApacheHttpImpl extends BaseTtPayServiceImpl { |
|
|
|
} |
|
|
|
|
|
|
|
private StringEntity createEntry(String requestStr) { |
|
|
|
try { |
|
|
|
return new StringEntity(new String(requestStr.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8)); |
|
|
|
} catch (UnsupportedEncodingException e) { |
|
|
|
//cannot happen |
|
|
|
this.log.error(e.getMessage(), e); |
|
|
|
return null; |
|
|
|
} |
|
|
|
return new StringEntity(requestStr, ContentType.create("application/json", "utf-8")); |
|
|
|
// try { |
|
|
|
// return new StringEntity(new String(requestStr.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8)); |
|
|
|
// } catch (UnsupportedEncodingException e) { |
|
|
|
// //cannot happen |
|
|
|
// this.log.error(e.getMessage(), e); |
|
|
|
// return null; |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
private HttpPost createHttpPost(String url, String requestStr) { |
|
|
|
|