Browse Source

栈板出立库

master
常熟吴彦祖 3 months ago
parent
commit
1fbf958539
  1. 6
      src/main/java/com/gaotao/common/utils/HttpUtils.java

6
src/main/java/com/gaotao/common/utils/HttpUtils.java

@ -88,7 +88,7 @@ public class HttpUtils {
try {
HttpRequest.Builder builder = HttpRequest.newBuilder()
.uri(URI.create(url))
.timeout(Duration.ofSeconds(60)) // 请求超时60秒 - rqrq
.timeout(Duration.ofSeconds(60))
.POST(HttpRequest.BodyPublishers.ofString(jsonBody))
.header("Content-Type", "application/json");
@ -98,10 +98,6 @@ public class HttpUtils {
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
return handleResponse(response);
} catch (java.net.http.HttpTimeoutException e) {
// 超时异常特殊处理 - rqrq
Thread.currentThread().interrupt();
throw new RuntimeException("WCS接口响应超时(30秒),请检查WCS服务或网络连接");
} catch (IOException | InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException("POST 请求失败: " + e.getMessage(), e);

Loading…
Cancel
Save