Revision 56150
Added by Alessia Bardi almost 5 years ago
VREPostJobNode.java | ||
---|---|---|
42 | 42 |
|
43 | 43 |
@Override |
44 | 44 |
protected String execute(final NodeToken token) throws Exception { |
45 |
|
|
46 |
log.debug("Posting text: "+getText()); |
|
47 |
|
|
45 | 48 |
CloseableHttpClient httpclient = HttpClients.createDefault(); |
46 | 49 |
try { |
47 | 50 |
URI postUri = new URIBuilder().setScheme(scheme).setHost(host).setPath(postPath).build(); |
... | ... | |
90 | 93 |
|
91 | 94 |
protected JSONObject createPostBody() { |
92 | 95 |
JSONObject obj = new JSONObject(); |
93 |
obj.put("text", text);
|
|
96 |
obj.put("text", text.replace("\\n", "\n"));
|
|
94 | 97 |
obj.put("preview_title", previewTitle); |
95 | 98 |
obj.put("preview_description", previewDescription); |
96 | 99 |
obj.put("image_url", httpImageUrl); |
Also available in: Unified diff
text from wf GUI comes with \\n instead of \n, so we clean the text before posting