|
|
|
@ -1,10 +1,11 @@
|
|
|
|
|
package com.docus.server.collection.httpservices.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.http.HttpRequest;
|
|
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
|
|
import com.docus.core.util.Func;
|
|
|
|
|
import com.docus.server.collection.dto.TBasicDto;
|
|
|
|
|
import com.docus.server.collection.httpservices.HttpTBasicService;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springblade.core.http.util.HttpUtil;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
@ -28,7 +29,14 @@ public class HttpTBasicServiceImpl implements HttpTBasicService {
|
|
|
|
|
try {
|
|
|
|
|
//发送get请求获取返货值
|
|
|
|
|
log.info("发送请求开始");
|
|
|
|
|
String resultStr = HttpUtil.get(url, headers, params);
|
|
|
|
|
HttpRequest get = HttpUtil.createGet(url);
|
|
|
|
|
for (Map.Entry<String, String> map : headers.entrySet()) {
|
|
|
|
|
get.header(map.getKey(),map.getValue());
|
|
|
|
|
}
|
|
|
|
|
get.form(params);
|
|
|
|
|
get.timeout(60*1000);
|
|
|
|
|
String resultStr = get.execute().body();
|
|
|
|
|
// String resultStr = HttpUtil.get(url, headers, params);
|
|
|
|
|
|
|
|
|
|
//解析返货值字符串
|
|
|
|
|
log.info("解析:"+resultStr);
|
|
|
|
|