ZQN
2024-06-22 e084539a1fbdf8335fcaf088969add8350bbd6a3
project-common/src/main/java/com/project/common/sms/YPSmsApi.java
@@ -1,13 +1,13 @@
package com.project.common.sms;
import com.project.common.constant.Constants;
import com.project.common.utils.SslUtils;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
@@ -15,6 +15,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.project.common.utils.WxPayUtils.createIgnoreSSLHttpClient;
/**
 * 短信http接口的java代码调用示例
@@ -96,11 +98,16 @@
     */
    public static String post(String url, Map<String, String> paramsMap)
    {
        CloseableHttpClient client = HttpClients.createDefault();
        CloseableHttpClient client = createIgnoreSSLHttpClient();
        String responseText = "";
        CloseableHttpResponse response = null;
        try {
            HttpPost method = new HttpPost(url);
            if(method.getURI().getPath().contains("https")){
                SslUtils.ignoreSsl();
            }
            if (paramsMap != null) {
                List<NameValuePair> paramList = new ArrayList<NameValuePair>();
                for (Map.Entry<String, String> param : paramsMap.entrySet()) {