|
|
@ -3,6 +3,7 @@ package com.hai.common.utils; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
|
|
|
import com.hai.common.pay.util.IOUtil; |
|
|
|
import org.apache.commons.io.IOUtils; |
|
|
|
import org.apache.commons.io.IOUtils; |
|
|
|
import org.apache.http.HttpEntity; |
|
|
|
import org.apache.http.HttpEntity; |
|
|
|
import org.apache.http.HttpResponse; |
|
|
|
import org.apache.http.HttpResponse; |
|
|
@ -315,7 +316,7 @@ public class HttpsUtils { |
|
|
|
for (Map.Entry<String, Object> entry : header.entrySet()) { |
|
|
|
for (Map.Entry<String, Object> entry : header.entrySet()) { |
|
|
|
httpPost.setHeader(entry.getKey(), entry.getValue().toString()); |
|
|
|
httpPost.setHeader(entry.getKey(), entry.getValue().toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
StringEntity stringEntity = new StringEntity(JSON.toJSONString(body), "UTF-8");// 解决中文乱码问题
|
|
|
|
StringEntity stringEntity = new StringEntity(IOUtil.urlEncode("from=" +body.get("from").toString(), "UTF-8"));// 解决中文乱码问题
|
|
|
|
stringEntity.setContentEncoding("UTF-8"); |
|
|
|
stringEntity.setContentEncoding("UTF-8"); |
|
|
|
stringEntity.setContentType("application/x-www-form-urlencoded"); |
|
|
|
stringEntity.setContentType("application/x-www-form-urlencoded"); |
|
|
|
httpPost.setEntity(stringEntity); |
|
|
|
httpPost.setEntity(stringEntity); |
|
|
|