# Can Watcher POST Webhook contain XML in the body?

**URL:** <https://discuss.elastic.co/t/can-watcher-post-webhook-contain-xml-in-the-body/64214>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [October 27, 2016, 10:08pm UTC](https://discuss.elastic.co/t/can-watcher-post-webhook-contain-xml-in-the-body/64214 "2016-10-27T22:08:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chromechris](https://avatars.discourse-cdn.com/v4/letter/c/e47c2d/32.png) [@chromechris](https://discuss.elastic.co/u/chromechris)\
**Post date:** [October 27, 2016, 10:08pm UTC](https://discuss.elastic.co/t/can-watcher-post-webhook-contain-xml-in-the-body/64214/1 "2016-10-27T22:08:06Z")

</div>

Can Watcher POST Webhook contain XML in the body? I have been using Sense (The Chrome Plugin) to send my watches, but when I try to create one using XML as part of a custom header POST Webhook Watch, I am unable to because of issues with double quotes with my XML in my body. I have tried using single quotes in my XML and that at least let's me curl the Watch, but then the action part of my Watch is what always fails with a "reason": "ConnectException[Connection refused]", even though the connection should be working.

Heres how my action looks like:

"actions" : {  
"my\_webhook" : {  
"webhook" : {  
"method" : "POST",  
"host" : "[host.sub.sub.com](http://host.sub.sub.com)",  
"port" : 3492,  
"path": "/thePath",  
"headers" : {  
"Content-Type" : "application/x-www-form-urlencoded"  
},  
"body" : "\<?xml version="1.0" encoding="UTF-8"?\>\<soapenv:Envelope xmlns:sum="[http://host.sub.com/path/path2/sum\_2](http://host.sub.com/path/path2/sum_2)" xmlns:soapenv="[http://host.sub.com/path/path2/](http://host.sub.com/path/path2/)"\>soapenv:Header/soapenv:Bodysum:Boomsum:Word1value\</sum:Word1\>sum:Word2value\</sum:Word2\>sum:Word3Value\</sum:Word3\>sum:Word4Value\</sum:Word4\>sum:Word5Value\</Word5:Ok\>sum:Word8value\</sum:Word8\>sum:Word9value\</sum:Word9\>sum:Word10value\</sum:Word10\>"\</sum:Boom\>\</soapenv:Body\>\</soapenv:Envelope\>"  
}  
}  
}

Thanks in advance, this thing is driving me nuts!

-Chrome

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 28, 2016, 7:21am UTC](https://discuss.elastic.co/t/can-watcher-post-webhook-contain-xml-in-the-body/64214/2 "2016-10-28T07:21:44Z")

</div>

Hey,

you still have to produce valid JSON, no matter what you put in the body. In this example this implies you need to escape the double ticks like this `\"`..

hope this helps.

--Alex

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:42pm UTC](https://discuss.elastic.co/t/can-watcher-post-webhook-contain-xml-in-the-body/64214/3 "2017-07-06T13:42:16Z")

</div>


