|
|
|
@ -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); |
|
|
|
|