Fix DELETE with body fails 01/85201/1
authorKanagaraj M <mkr1481@gmail.com>
Fri, 12 Apr 2019 10:56:09 +0000 (16:26 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Fri, 12 Apr 2019 10:59:52 +0000 (16:29 +0530)
Issue-ID: CLI-154

Change-Id: I1228d3ddff11c2eabb3fd0acc40e0063afcfd09b
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java

index 186383d..5b85ca9 100644 (file)
@@ -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();
         }
 
     }