# Send XML with HTTP Request

**URL:** <https://community.n8n.io/t/send-xml-with-http-request/334>\
**Category:** Questions\
**Created:** [November 1, 2019, 8:28pm UTC](https://community.n8n.io/t/send-xml-with-http-request/334 "2019-11-01T20:28:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonardlin](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/leonardlin/32/44_2.png) [@leonardlin](https://community.n8n.io/u/leonardlin)\
**Post date:** [November 1, 2019, 8:28pm UTC](https://community.n8n.io/t/send-xml-with-http-request/334/1 "2019-11-01T20:28:48Z")

</div>

I tried to send an XML message in the body of a HTTP Post Request.

I used the HTTP Request node for that with the body set:

 ![image](https://europe1.discourse-cdn.com/n8n/original/1X/405a8e4b827f1212a78dce9d41c55a11c989fbd0.png)

I got this error:

 ![image](https://europe1.discourse-cdn.com/n8n/original/1X/d776b05dcec11d18a79d866cec312d8d0ca55af7.png)

I looked into the code and it tries to parse the string to a json object.

Is it correct that the current http request node can send only, files, webforms and json bodies?

If so, I would try to add the feature to send plain string with the http-request node.

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [November 1, 2019, 9:10pm UTC](https://community.n8n.io/t/send-xml-with-http-request/334/2 "2019-11-01T21:10:10Z")

</div>

Yes, that is true. That is right now sadly not possible.

The reason for that is that it currently always does a JSON.parse in line 561. It would probably need a “useRawData” option like the MoveBinaryData-Node. Additionally, would it be needed to define a custom content-type, to set it in this case to “application/xml”. Any help there would be very appreciated!

---

<div class="post-metadata">

**Author:** ![leonardlin](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/leonardlin/32/44_2.png) [@leonardlin](https://community.n8n.io/u/leonardlin)\
**Post date:** [November 2, 2019, 9:22am UTC](https://community.n8n.io/t/send-xml-with-http-request/334/3 "2019-11-02T09:22:23Z")

</div>

I opened a PR:  
[https://github.com/n8n-io/n8n/pull/102](https://github.com/n8n-io/n8n/pull/102)

While testing I noticed that the “Webhook Node” cannot handle non-json bodies.  
I first created a “webhook”-workflow as recipient-bin for testing. I was never able to get the body.  
I compared the requestOptions 1:1 to request-promise documentation and couldn’t see a difference.

So I sent it against one of the webhook-sites (requestbin etc.). There it worked just fine.

While I’m at it, I tried to extend the webhook-node to accept xml bodies, but I noticed that the parsing happens very deep in the core code of [n8n.io](http://n8n.io). So I stopped.

Anyway, have a look at the extension to at least send raw-strings.

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [November 2, 2019, 9:56pm UTC](https://community.n8n.io/t/send-xml-with-http-request/334/4 "2019-11-02T21:56:26Z")

</div>

Thanks a lot your PR got merged and released with n8n@0.32.0

Yes, you are probably right that the webhook has issues with none JSON data. I have to look into that once I find some time.

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [December 14, 2019, 12:59am UTC](https://community.n8n.io/t/send-xml-with-http-request/334/5 "2019-12-14T00:59:51Z")

</div>

[quansenB](https://github.com/quansenB) made it now possible to also send XML data to n8n webhooks with this pull-request: [Xml body parser webhooks by quansenB · Pull Request #150 · n8n-io/n8n · GitHub](https://github.com/n8n-io/n8n/pull/150)

It got released with n8n@0.39.0
