# Http in and "application/xml"

**URL:** <https://discourse.nodered.org/t/http-in-and-application-xml/1492>\
**Category:** General\
**Created:** [11 July 2018 00:06 UTC](https://discourse.nodered.org/t/http-in-and-application-xml/1492 "2018-07-11T00:06:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomasinouk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tomasinouk/32/442_2.png) [@tomasinouk](https://discourse.nodered.org/u/tomasinouk)\
**Post date:** [11 July 2018 00:06 UTC](https://discourse.nodered.org/t/http-in-and-application-xml/1492/1 "2018-07-11T00:06:04Z")

</div>

Hi guys, I am having a problem with "http-in" node as it does drops the content " **body**" of the request.

I have a device sending a data in XML format, have configured " **http-in**" node for a POST and when i send JSON, form-data, a file i get the data.  
When i send XML data the " **params**", " **body**" is a empty.  
Here is what I see, when I use Postman to simulate.  
I can see all in headers section:

`{"host":"example.com","user-agent":"PostmanRuntime/7.1.5","content-length":"945","accept":"*/*","accept-encoding":"gzip, deflate","cache-control":"no-cache","content-type":"application/xml","postman-token":"dd8b275a-caa2-4658-9e32-ac4cf4ea8d98","x-forwarded-for":"1.1.1.1","x-forwarded-host":"example.com","x-forwarded-port":"443","x-forwarded-proto":"https","x-forwarded-server":"c881bec96932","x-real-ip":"1.1.1.1"}`

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/db2bd5aeffedd4f34281ddd852148771587c5749.png)

anyone would have an idea, what I need to change?  
Thank you

---

<div class="post-metadata">

**Author:** ![tomasinouk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tomasinouk/32/442_2.png) [@tomasinouk](https://discourse.nodered.org/u/tomasinouk)\
**Post date:** [11 July 2018 01:11 UTC](https://discourse.nodered.org/t/http-in-and-application-xml/1492/2 "2018-07-11T01:11:56Z")

</div>

the reason would be that Express does not have `XML` middleware.

now to figure how to do  
`npm install express-xml-bodyparser --save` for express for **http-in** node.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [11 July 2018 06:20 UTC](https://discourse.nodered.org/t/http-in-and-application-xml/1492/3 "2018-07-11T06:20:35Z")

</div>

What does `msg.payload` contain?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [11 July 2018 09:04 UTC](https://discourse.nodered.org/t/http-in-and-application-xml/1492/4 "2018-07-11T09:04:29Z")

</div>

Quick test shows `msg.payload` contains the unparsed XML as a String; so you can pass that to through an XML node to get the parsed version.

If you really wanted to add extra middleware, then you can use `httpNodeMiddleware` in your settings file to add additional custom middleware to the HTTP nodes.

---

<div class="post-metadata">

**Author:** ![tomasinouk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tomasinouk/32/442_2.png) [@tomasinouk](https://discourse.nodered.org/u/tomasinouk)\
**Post date:** [11 July 2018 11:16 UTC](https://discourse.nodered.org/t/http-in-and-application-xml/1492/5 "2018-07-11T11:16:28Z")

</div>

awesome, that will do for me, after digging further as I originally used a device manual and did not check headers , or did not look close enough 🙂  
the device is sending a POST request **without** a `Content-Type` parameter. That is the reason for empty `msg.payload`.

I have solved it in meanwhile using express js server and adding express `bodyparser.raw()` to handle this type of request and Post parsed XML to the **node-red** `http-in`.

will try to mod a `settins.js` file as well,  
Thank you
