From b15aaa9a3c2ba790e1742ee4705cc993062de354 Mon Sep 17 00:00:00 2001 From: charitha Date: Fri, 17 Nov 2017 15:47:07 +0530 Subject: [PATCH] Fix issue in event payload building --- .../carbon/device/mgt/output/adapter/http/HTTPEventAdapter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.http/src/main/java/org/wso2/carbon/device/mgt/output/adapter/http/HTTPEventAdapter.java b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.http/src/main/java/org/wso2/carbon/device/mgt/output/adapter/http/HTTPEventAdapter.java index b93074c72..a069b586f 100644 --- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.http/src/main/java/org/wso2/carbon/device/mgt/output/adapter/http/HTTPEventAdapter.java +++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.http/src/main/java/org/wso2/carbon/device/mgt/output/adapter/http/HTTPEventAdapter.java @@ -186,6 +186,8 @@ public class HTTPEventAdapter implements OutputEventAdapter { String payload = message.toString(); if ("true".equals(dynamicProperties.get(HTTPEventAdapterConstants.ADAPTER_MESSAGE_URL_TEMPLATED))) { + contentType = "application/json"; + payload = payload.replace("'", "\\\""); try { JSONParser jsonParser = new JSONParser(); JSONObject jsonPayload = (JSONObject) jsonParser.parse(payload);