From 69e38b3c9840b6cf017ec322838c01a7e143231a Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Wed, 20 Apr 2016 22:02:31 +0530 Subject: [PATCH] adding JSON strigify on payload if contentType is json --- .../public/js/invoker-lib.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.service-invoker-utility/public/js/invoker-lib.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.service-invoker-utility/public/js/invoker-lib.js index c94345469f..1a7c52198b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.service-invoker-utility/public/js/invoker-lib.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.service-invoker-utility/public/js/invoker-lib.js @@ -55,6 +55,9 @@ var invokerUtil = function () { paramValue.actionMethod = methoad; paramValue.actionUrl = url; paramValue.actionPayload = payload; + if(acceptType == "application/json"){ + paramValue.actionPayload = JSON.stringify(payload); + } data.data = JSON.stringify(paramValue); $.ajax(data).fail(function (jqXHR) { if (jqXHR.status == "401") {