From 08c64c6f4191850f921f558640182cfab09aa691 Mon Sep 17 00:00:00 2001 From: Robert Sehr Date: Tue, 10 Dec 2024 07:14:35 +0100 Subject: [PATCH] success message: body is optional --- .../goobi/plugins/DownloadAndVerifyAssetsStepPlugin.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/module-base/src/main/java/de/intranda/goobi/plugins/DownloadAndVerifyAssetsStepPlugin.java b/module-base/src/main/java/de/intranda/goobi/plugins/DownloadAndVerifyAssetsStepPlugin.java index 9131a1f..cdc12a2 100644 --- a/module-base/src/main/java/de/intranda/goobi/plugins/DownloadAndVerifyAssetsStepPlugin.java +++ b/module-base/src/main/java/de/intranda/goobi/plugins/DownloadAndVerifyAssetsStepPlugin.java @@ -547,10 +547,11 @@ private boolean sendResponseViaRest(String method, String url, String json) { } try (CloseableHttpClient client = HttpClients.createDefault()) { - httpBase.setHeader("Accept", "application/json"); - httpBase.setHeader("Content-type", "application/json"); - httpBase.setEntity(new StringEntity(json)); - + if (StringUtils.isNotBlank(json)) { + httpBase.setHeader("Accept", "application/json"); + httpBase.setHeader("Content-type", "application/json"); + httpBase.setEntity(new StringEntity(json)); + } log.info("Executing request " + httpBase.getRequestLine()); String responseBody = client.execute(httpBase, HttpUtils.stringResponseHandler);