# GET request of XML page

**URL:** <https://discourse.nodered.org/t/get-request-of-xml-page/82314>\
**Category:** General\
**Created:** [24 October 2023 21:12 UTC](https://discourse.nodered.org/t/get-request-of-xml-page/82314 "2023-10-24T21:12:17Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jttjtt](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@jttjtt](https://discourse.nodered.org/u/jttjtt)\
**Post date:** [24 October 2023 21:12 UTC](https://discourse.nodered.org/t/get-request-of-xml-page/82314/1 "2023-10-24T21:12:17Z")

</div>

I have a RFID reader, which I can call by a HTTP request on address for example:

[http://192.168.1.15/status.xml](http://192.168.1.15/status.xml)

There is a basic authentication, when I run the address above in chrome browser and then I get a response:

```auto
<status>
<netbios>NANO RFID </netbios>
<mac>E8EB1B487A52</mac>
<id>1E009BF6CA</id>
<newId>0</newId>
<cnt>1</cnt>
<resetFlag>1</resetFlag>
<enable>1</enable>
<httpClientStatus>0</httpClientStatus>
<out>0</out>
<in>1</in>
<model>RFID NANO</model>
<fw>0.46</fw>
<hw>1.0</hw>
</status>

```

When I have tried the http request node, i get this error : RequestError: Parse Error: Invalid header token : [http://192.168.1.15/status.xml](http://192.168.1.15/status.xml)

When I have checked the headers of the status.xml page, i can see this:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/a/0a05c5520591289bf4fa91ce805ab9ae4186c7cf.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/b/5b9b50fbeb78d9ad63e4318d90eb2f42fc42c088.png)

This is configuration of the node:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/9/b9d2029b4bc2254213739e3a6cd584e09eae253d.png)

The question is - how to get the http request node working? Thanks for help!

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 October 2023 05:51 UTC](https://discourse.nodered.org/t/get-request-of-xml-page/82314/2 "2023-10-25T05:51:22Z")

</div>

What version of Node-RED and node JS are you running? Disable strict didn't work properly prior to node-red v3.1.0

Also, try to show us the raw response from the request - I suspect the device is responding with poorly formatted headers (chrome is more forgiving)

---

<div class="post-metadata">

**Author:** ![jttjtt](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@jttjtt](https://discourse.nodered.org/u/jttjtt)\
**Post date:** [25 October 2023 06:29 UTC](https://discourse.nodered.org/t/get-request-of-xml-page/82314/3 "2023-10-25T06:29:07Z")

</div>

Hello, i am running node red v.3.1.0 and Node JS version 20.9.0.

The response headers I see in chrome is :  
HTTP/1.1 200 OK  
Connection: close  
Content-Type: text/xml  
Access-Control-Allow-Origin: \*  
Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"  
Access-Control-Max-Age "1000"  
Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"  
Cache-Control: no-cache

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 October 2023 07:56 UTC](https://discourse.nodered.org/t/get-request-of-xml-page/82314/4 "2023-10-25T07:56:48Z")

</div>

Your earlier post:

> [@jttjtt](#):
>
> i can see this:  
> ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/a/0a05c5520591289bf4fa91ce805ab9ae4186c7cf.png)  
> ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/b/5b9b50fbeb78d9ad63e4318d90eb2f42fc42c088.png)

Your raw post:

> [@jttjtt](#):
>
> Connection: close  
> Content-Type: text/xml  
> Access-Control-Allow-Origin: \*  
> Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"  
> Access-Control-Max-Age "1000"  
> Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"  
> Cache-Control: no-cache

Several of them headers are invalid (no `:` colon) - you should see if the device has a firmware update (or report it to the device maintainers)

That's why Chrome is only showing 4 parsed headers in the image.

This may be an upstream issue with `got` library or may be Node-RED needs to tell got to ignore invalid headers.

Unfortunately I am away from computers for the next week so can't help further at this point. Hopefully someone else on the forum can help further until I am able to look deeper into the issue.

If this is blocking you and you cannot wait, then you might want to try running cURL via the exec node or importing `fetch` in a function node.

---

<div class="post-metadata">

**Author:** ![jttjtt](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@jttjtt](https://discourse.nodered.org/u/jttjtt)\
**Post date:** [25 October 2023 08:33 UTC](https://discourse.nodered.org/t/get-request-of-xml-page/82314/5 "2023-10-25T08:33:24Z")

</div>

I was trying to use exec node, i set it up like this:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e9668125e948dcd2e8518e0c184e290e63265e3d.png)

I run this command: curl [http://192.168.1.15/status.xml](http://192.168.1.15/status.xml) -u "admin:admin00"

But the exec node is returning error 8... When i try to run the command in command line in windows, i got:  
curl: (8) Header without colon

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 October 2023 08:53 UTC](https://discourse.nodered.org/t/get-request-of-xml-page/82314/6 "2023-10-25T08:53:38Z")

</div>

> [@jttjtt](#):
>
> i got:  
> curl: (8) Header without colon

That backs up my previous statement!

Have you looked for updated firmware? Contacted the device manufacturer?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [25 October 2023 08:54 UTC](https://discourse.nodered.org/t/get-request-of-xml-page/82314/7 "2023-10-25T08:54:13Z")

</div>

That would seem to confirm what @Steve-Mcl said - the server is sending an invalid set of headers without : in. Curl error 8 is also "weird reply from server" so yes... need you to fix the server.

---

<div class="post-metadata">

**Author:** ![jttjtt](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@jttjtt](https://discourse.nodered.org/u/jttjtt)\
**Post date:** [25 October 2023 09:14 UTC](https://discourse.nodered.org/t/get-request-of-xml-page/82314/8 "2023-10-25T09:14:02Z")

</div>

Such a strict policy :)... I am communicating with manufacturer, I hope they will help.They are from Poland...

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [25 October 2023 09:50 UTC](https://discourse.nodered.org/t/get-request-of-xml-page/82314/9 "2023-10-25T09:50:50Z")

</div>

> [@jttjtt](#):
>
> Such a strict policy 🙂

yeah I mean the http standard has only been around since 1999 - not like people haven't had a chance to read it yet... 😉

---

<div class="post-metadata">

**Author:** ![jttjtt](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@jttjtt](https://discourse.nodered.org/u/jttjtt)\
**Post date:** [25 October 2023 10:07 UTC](https://discourse.nodered.org/t/get-request-of-xml-page/82314/10 "2023-10-25T10:07:37Z")

</div>

I think, that developers in China have their own opinion on this standard :). I got new FW for the reader, so I am going to test it now...

---

<div class="post-metadata">

**Author:** ![jttjtt](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@jttjtt](https://discourse.nodered.org/u/jttjtt)\
**Post date:** [27 October 2023 13:50 UTC](https://discourse.nodered.org/t/get-request-of-xml-page/82314/11 "2023-10-27T13:50:06Z")

</div>

So the uppdate of FW helped. Now, the http server is returing good headers and both solution - using http request node and using curl is working OK. Thanks for help.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [27 October 2023 14:48 UTC](https://discourse.nodered.org/t/get-request-of-xml-page/82314/12 "2023-10-27T14:48:49Z")

</div>

Thank goodness for the power of standards 😉

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 November 2023 14:49 UTC](https://discourse.nodered.org/t/get-request-of-xml-page/82314/13 "2023-11-10T14:49:47Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
