|
|
|
@ -5,6 +5,7 @@ import com.xkcoding.http.HttpUtil;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.jeecg.config.RestTemplateConfig;
|
|
|
|
|
import org.jeecg.config.sign.util.HttpUtils;
|
|
|
|
|
import org.springframework.http.*;
|
|
|
|
|
import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
|
|
|
|
import org.springframework.http.converter.StringHttpMessageConverter;
|
|
|
|
@ -13,6 +14,7 @@ import org.springframework.util.MultiValueMap;
|
|
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
import java.net.URLConnection;
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.security.KeyManagementException;
|
|
|
|
|
import java.security.KeyStoreException;
|
|
|
|
@ -284,21 +286,15 @@ public class RestUtil {
|
|
|
|
|
} catch (KeyStoreException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
MultiValueMap<String, Object> headers = new LinkedMultiValueMap<String, Object>();
|
|
|
|
|
headers.add("Accept", "*/*");
|
|
|
|
|
headers.add("Content-Type", "application/json");
|
|
|
|
|
try {
|
|
|
|
|
SslUtils.ignoreSsl();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String requestBody = requestBodyJson.toJSONString();
|
|
|
|
|
String result = HttpUtil.post(httpUrl, requestBodyJson.toJSONString());
|
|
|
|
|
//打开建立连接
|
|
|
|
|
log.debug("post_responseBody:");
|
|
|
|
|
log.debug(result);
|
|
|
|
|
/*HttpEntity entity = new HttpEntity(requestBody, headers);
|
|
|
|
|
ResponseEntity<String> responseEntity=restTemplate.postForEntity(httpUrl,entity,String.class);*/
|
|
|
|
|
//获取返回结果
|
|
|
|
|
return JSONObject.parseObject(result);
|
|
|
|
|
}
|
|
|
|
|