From 3052887f9d256cdf976777a07847db32d58a5047 Mon Sep 17 00:00:00 2001 From: Costantino Perciante Date: Mon, 8 May 2017 09:56:29 +0000 Subject: [PATCH] fixed writepostcatalogue call in the way it builds the request json object git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/catalogue-ws@148361 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../catalogue/utils/WritePostCatalogueManagerThread.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/gcube/datacatalogue/catalogue/utils/WritePostCatalogueManagerThread.java b/src/main/java/org/gcube/datacatalogue/catalogue/utils/WritePostCatalogueManagerThread.java index fc3b0e5..9394e68 100644 --- a/src/main/java/org/gcube/datacatalogue/catalogue/utils/WritePostCatalogueManagerThread.java +++ b/src/main/java/org/gcube/datacatalogue/catalogue/utils/WritePostCatalogueManagerThread.java @@ -209,7 +209,10 @@ public class WritePostCatalogueManagerThread extends Thread { logger.info("The post that is going to be written is -> " + message); - HttpResponse response = performRequest(client, path, "{\"text\":\"" + message + "\", \"enable_notification\" : "+ enablePostNotification+ "}"); + JSONObject objRequest = new JSONObject(); + objRequest.put("text", message); + objRequest.put("enable_notification", enablePostNotification); + HttpResponse response = performRequest(client, path, objRequest.toJSONString()); int statusWritePost = response.getStatusLine().getStatusCode(); if(statusWritePost == HttpURLConnection.HTTP_CREATED){