This commit is contained in:
zj
2025-12-31 14:38:44 +08:00
parent 8f247d2797
commit 4fda2477f6
31 changed files with 587 additions and 218 deletions

View File

@@ -25,7 +25,7 @@ import org.springframework.http.MediaType;
/**
* 通用http发送方法
*
*
* @author ruoyi
*/
public class HttpUtils
@@ -132,7 +132,7 @@ public class HttpUtils
/**
* 向指定 URL 发送POST方法的请求
*
*
* @param url 发送请求的 URL
* @param param 请求参数
* @param contentType 内容类型
@@ -148,10 +148,11 @@ public class HttpUtils
log.info("sendPost - {}", url);
URL realUrl = new URL(url);
URLConnection conn = realUrl.openConnection();
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
conn.setRequestProperty("Accept-Charset", "utf-8");
conn.setRequestProperty("digi-key", "8462368FDC41FF7AA846DDDAF283D52E");
conn.setRequestProperty("digi-host", "{\"ver\":\"5.7\",\"prod\":\"YLTK\",\"timezone\":\"+8\",\"ip\":\"192.168.116.1\",\"id\":\"\",\"lang\":\"zh_CN\",\"acct\":\"dcms\",\"timestamp\":\"2018071990007275\"}");
conn.setRequestProperty("digi-service", "{\"prod\":\"E10\",\"ip\":\"192.168.116.179\",\"name\":\"yltk.transaction_doc.create\",\"id\":\"BY_External\"}");
conn.setRequestProperty("digi-data-exchange-protocol", "1.0");
conn.setRequestProperty("digi-type", "sync");
conn.setRequestProperty("Content-Type", contentType);
conn.setDoOutput(true);
conn.setDoInput(true);