From: Kanagaraj M Date: Fri, 12 Apr 2019 10:56:09 +0000 (+0530) Subject: Fix DELETE with body fails X-Git-Tag: 3.0.0~19 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=47d5bfc7f5acf4967c53bbd6b1755842118f1312;p=cli.git Fix DELETE with body fails Issue-ID: CLI-154 Change-Id: I1228d3ddff11c2eabb3fd0acc40e0063afcfd09b Signed-off-by: Kanagaraj Manickam k00365106 --- diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java index 186383d9..5b85ca9a 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java @@ -312,7 +312,7 @@ public class OnapHttpConnection { } else if ("delete".equals(input.getMethod())) { if (!input.getBody().isEmpty()) { HttpDeleteWithBody httpDelete = new HttpDeleteWithBody(); - httpDelete.setEntity(this.getStringEntity(input)); + httpDelete.setEntity(new StringEntity(input.getBody(), ContentType.APPLICATION_JSON)); requestBase = httpDelete; } else { requestBase = new HttpDelete(); @@ -401,7 +401,7 @@ public class OnapHttpConnection { } public String getMethod() { - return OnapCommandHttpConstants.DELETE; + return OnapCommandHttpConstants.DELETE.toUpperCase(); } }