diff --git a/core/src/main/java/org/dcsa/conformance/core/party/ConformanceParty.java b/core/src/main/java/org/dcsa/conformance/core/party/ConformanceParty.java index da12baf3..8030c37f 100644 --- a/core/src/main/java/org/dcsa/conformance/core/party/ConformanceParty.java +++ b/core/src/main/java/org/dcsa/conformance/core/party/ConformanceParty.java @@ -18,6 +18,7 @@ import org.dcsa.conformance.core.scenario.ConformanceAction; import org.dcsa.conformance.core.state.JsonNodeMap; import org.dcsa.conformance.core.state.StatefulEntity; +import org.dcsa.conformance.core.toolkit.JsonToolkit; import org.dcsa.conformance.core.traffic.ConformanceMessage; import org.dcsa.conformance.core.traffic.ConformanceMessageBody; import org.dcsa.conformance.core.traffic.ConformanceRequest; @@ -229,12 +230,15 @@ private void _asyncCounterpartPatchPostOrPut( counterpartConfiguration.getName(), counterpartConfiguration.getRole(), counterpartConfiguration.getAuthHeaderName().isBlank() - ? Map.of("Api-Version", List.of(apiVersion)) - : Map.of( - "Api-Version", - List.of(apiVersion), - counterpartConfiguration.getAuthHeaderName(), - List.of(counterpartConfiguration.getAuthHeaderValue())), + ? Map.ofEntries( + Map.entry("Api-Version", List.of(apiVersion)), + Map.entry("Content-Type", List.of(JsonToolkit.JSON_UTF_8))) + : Map.ofEntries( + Map.entry("Api-Version", List.of(apiVersion)), + Map.entry("Content-Type", List.of(JsonToolkit.JSON_UTF_8)), + Map.entry( + counterpartConfiguration.getAuthHeaderName(), + List.of(counterpartConfiguration.getAuthHeaderValue()))), new ConformanceMessageBody(jsonBody), System.currentTimeMillis())), responseCallback); diff --git a/core/src/main/java/org/dcsa/conformance/core/toolkit/JsonToolkit.java b/core/src/main/java/org/dcsa/conformance/core/toolkit/JsonToolkit.java index e854f27f..eb740c02 100644 --- a/core/src/main/java/org/dcsa/conformance/core/toolkit/JsonToolkit.java +++ b/core/src/main/java/org/dcsa/conformance/core/toolkit/JsonToolkit.java @@ -15,7 +15,7 @@ public enum JsonToolkit { ; // no instances - public static final String JSON_UTF_8 = "application/json;charset=utf-8"; + public static final String JSON_UTF_8 = "application/json"; @SneakyThrows public static JsonNode stringToJsonNode(String string) {