From fa9912503ad15734452a806cef08cc59a1a77498 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 13 Jun 2023 12:32:29 -0400 Subject: Support HTTP PATCH in AAI adaptor Update AAI adaptor to send proper HTTP header to use HTTP PATCH Issue-ID: CCSDK-3908 Signed-off-by: Dan Timoney Change-Id: I231c19127789e66a65d73b6d58386079e618a515 --- .../org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'adaptors/aai-service/provider/src') diff --git a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java index 6083e89ba..156867a2b 100755 --- a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java +++ b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java @@ -805,7 +805,12 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface { con.setUseCaches(false); con.setConnectTimeout(connection_timeout); con.setReadTimeout(read_timeout); - con.setRequestMethod(method); + if ("PATCH".equalsIgnoreCase(method)) { + con.setRequestMethod("POST"); + con.setRequestProperty("X-HTTP-Method-Override", "PATCH"); + } else { + con.setRequestMethod(method); + } con.setRequestProperty("Accept", "application/json"); con.setRequestProperty("Transfer-Encoding","chunked"); con.setRequestProperty("Content-Type", -- cgit 1.2.3-korg