summaryrefslogtreecommitdiffstats
path: root/restapi-call-node
diff options
context:
space:
mode:
Diffstat (limited to 'restapi-call-node')
-rw-r--r--restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java1
-rw-r--r--restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java6
2 files changed, 7 insertions, 0 deletions
diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java
index c170cfc7d..d3fec37ee 100644
--- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java
+++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java
@@ -49,4 +49,5 @@ public class Parameters {
public String oAuthSignatureMethod;
public String oAuthVersion;
public AuthType authtype;
+ public Boolean returnRequestPayload;
}
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 d215d9092..5168b3ec1 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
@@ -112,6 +112,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
* <tr><td>customHttpHeaders</td><td>Optional</td><td>a list additional http headers to be passed in, follow the format in the example</td><td>X-CSI-MessageId=messageId,headerFieldName=headerFieldValue</td></tr>
* <tr><td>dumpHeaders</td><td>Optional</td><td>when true writes http header content to context memory</td><td>true or false</td></tr>
* <tr><td>partner</td><td>Optional</td><td>needed for DME2 calls</td><td>dme2proxy</td></tr>
+ * <tr><td>returnRequestPayload</td><td>Optional</td><td>used to return payload built in the request</td><td>true or false</td></tr>
* </tbody>
* </table>
* @param ctx Reference to context memory
@@ -150,6 +151,10 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
ctx.setAttribute(pp + "header." + a.getKey(), StringUtils.join(a.getValue(), ","));
}
}
+
+ if (p.returnRequestPayload && req != null) {
+ ctx.setAttribute(pp + "httpRequest", req);
+ }
if (r.body != null && r.body.trim().length() > 0) {
ctx.setAttribute(pp + "httpResponse", r.body);
@@ -246,6 +251,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", false, null);
p.partner = parseParam(paramMap, "partner", false, null);
p.dumpHeaders = Boolean.valueOf(parseParam(paramMap, "dumpHeaders", false, null));
+ p.returnRequestPayload = Boolean.valueOf(parseParam(paramMap, "returnRequestPayload", false, null));
return p;
}