aboutsummaryrefslogtreecommitdiffstats
path: root/restapi-call-node/provider
diff options
context:
space:
mode:
Diffstat (limited to 'restapi-call-node/provider')
-rw-r--r--restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java4
-rw-r--r--restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java5
2 files changed, 7 insertions, 2 deletions
diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java
index 776485af..1578ee32 100644
--- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java
+++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java
@@ -22,13 +22,15 @@
package org.onap.ccsdk.sli.plugins.restapicall;
public enum Format {
- JSON, XML;
+ JSON, XML, NONE;
public static Format fromString(String s) {
if ("json".equalsIgnoreCase(s))
return JSON;
if ("xml".equalsIgnoreCase(s))
return XML;
+ if ("none".equalsIgnoreCase(s))
+ return NONE;
throw new IllegalArgumentException("Invalid value for format: " + s);
}
}
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 e5c18596..ea2d259b 100644
--- 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
@@ -437,7 +437,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
Client client = Client.create(config);
client.setConnectTimeout(5000);
- if (p.restapiUser != null)
+ if (p.restapiUser != null && p.restapiPassword != null)
client.addFilter(new HTTPBasicAuthFilter(p.restapiUser, p.restapiPassword));
WebResource webResource = client.resource(p.restapiUrl);
@@ -457,6 +457,9 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
}
WebResource.Builder webResourceBuilder = webResource.accept(tt).type(tt1);
+ if(p.format == Format.NONE){
+ webResourceBuilder = webResource.header("","");
+ }
if (p.customHttpHeaders != null && p.customHttpHeaders.length() > 0) {
String[] keyValuePairs = p.customHttpHeaders.split(",");