X-Git-Url: https://gerrit.onap.org/r/gitweb?p=ccsdk%2Fsli%2Fplugins.git;a=blobdiff_plain;f=restapi-call-node%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fccsdk%2Fsli%2Fplugins%2Frestapicall%2FRestapiCallNode.java;fp=restapi-call-node%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fccsdk%2Fsli%2Fplugins%2Frestapicall%2FRestapiCallNode.java;h=b93887ffcfcf26386ae62911d4cb6fa1bce8fab7;hp=8038b94ce883febcebf3df5a39fa095ecf2ee7dd;hb=eb00a7cdf2828a3030595e14e142ad1250b45e5b;hpb=300ec08d358c3b23bd65e96a0f642b9a8e86106e diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 8038b94c..b93887ff 100755 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -788,8 +788,6 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { WebTarget webTarget = addAuthType(client, p).target(p.restapiUrl); - log.info("Sending request below to url " + p.restapiUrl); - log.info(request); long t1 = System.currentTimeMillis(); HttpResponse r = new HttpResponse(); @@ -828,7 +826,15 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { Response response; try { - response = invocationBuilder.method(p.httpMethod.toString(), entity(request, contentType)); + // When the HTTP operation has no body do not set the content-type + //setting content-type has caused errors with some servers when no body is present + if (request == null) { + response = invocationBuilder.method(p.httpMethod.toString()); + } else { + log.info("Sending request below to url " + p.restapiUrl); + log.info(request); + response = invocationBuilder.method(p.httpMethod.toString(), entity(request, contentType)); + } } catch (ProcessingException | IllegalStateException e) { throw new SvcLogicException(requestPostingException + e.getLocalizedMessage(), e); }