提交所有代码
This commit is contained in:
@@ -73,6 +73,9 @@ public class HttpUtils
|
||||
log.info("sendGet - {}", urlNameString);
|
||||
URL realUrl = new URL(urlNameString);
|
||||
URLConnection connection = realUrl.openConnection();
|
||||
// 连接/读超时: 防止外部接口不可达时无限挂起 (后台子任务会占死单线程调度器)
|
||||
connection.setConnectTimeout(10000);
|
||||
connection.setReadTimeout(30000);
|
||||
connection.setRequestProperty("accept", "*/*");
|
||||
connection.setRequestProperty("connection", "Keep-Alive");
|
||||
connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
|
||||
|
||||
Reference in New Issue
Block a user