# Getting Error: "Parse Error: Expected HTTP" - "HPE\_INVALID\_CONSTANT"

**URL:** <https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868>\
**Category:** General\
**Created:** [18 May 2021 16:15 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868 "2021-05-18T16:15:16Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![NoeudRouge](https://avatars.discourse-cdn.com/v4/letter/n/13edae/32.png) [@NoeudRouge](https://discourse.nodered.org/u/NoeudRouge)\
**Post date:** [20 May 2021 09:30 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868/21 "2021-05-20T09:30:26Z")

</div>

Dear Steve,

Sorry for not replying directly to your questions but I tried so many things that I forgot what I have tried and not.  
For your questions:

- No new firmware available
- No other protocol available

By reading the documentation again I found some hope by reading that another web page (xml) was available which returns more details. But apparently that page does not exists. I tried to query it.

I have read your comment in another post about http 0.9

Sined

---

<div class="post-metadata">

**Author:** ![NoeudRouge](https://avatars.discourse-cdn.com/v4/letter/n/13edae/32.png) [@NoeudRouge](https://discourse.nodered.org/u/NoeudRouge)\
**Post date:** [20 May 2021 09:46 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868/22 "2021-05-20T09:46:52Z")

</div>

I will try with the proposed method with the TCP Node but not sure how to add the credentials in the payload.

---

<div class="post-metadata">

**Author:** ![NoeudRouge](https://avatars.discourse-cdn.com/v4/letter/n/13edae/32.png) [@NoeudRouge](https://discourse.nodered.org/u/NoeudRouge)\
**Post date:** [20 May 2021 09:47 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868/23 "2021-05-20T09:47:49Z")

</div>

I have also read a comment about using a command node with a curl command in it. This could also be a solution.

---

<div class="post-metadata">

**Author:** ![NoeudRouge](https://avatars.discourse-cdn.com/v4/letter/n/13edae/32.png) [@NoeudRouge](https://discourse.nodered.org/u/NoeudRouge)\
**Post date:** [20 May 2021 09:51 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868/24 "2021-05-20T09:51:35Z")

</div>

> [@NoeudRouge](#):
>
> `Authorization: Basic Base64Username:Password`

I found the answer in my response earlier.

---

<div class="post-metadata">

**Author:** ![Ranki](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ranki/32/41282_2.png) [@Ranki](https://discourse.nodered.org/u/Ranki)\
**Post date:** [20 May 2021 10:04 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868/25 "2021-05-20T10:04:42Z")

</div>

Maybe a silly question, but what happens, if you just ignore the output? You want to open the door and it will open ... what else matters? 😉

---

<div class="post-metadata">

**Author:** ![NoeudRouge](https://avatars.discourse-cdn.com/v4/letter/n/13edae/32.png) [@NoeudRouge](https://discourse.nodered.org/u/NoeudRouge)\
**Post date:** [20 May 2021 11:01 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868/26 "2021-05-20T11:01:29Z")

</div>

There is no possibility in the HTTP Request node to specify not to bother about the response. The flow does not continue if it encounters a error.

---

<div class="post-metadata">

**Author:** ![Ranki](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ranki/32/41282_2.png) [@Ranki](https://discourse.nodered.org/u/Ranki)\
**Post date:** [20 May 2021 11:06 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868/27 "2021-05-20T11:06:58Z")

</div>

Hello @NoeudRouge,

ok, that would be bad, but is it like that? The debug flow also receive an output, so every other node after the http-node should get an output too?!

Cheers  
Ranki

---

<div class="post-metadata">

**Author:** ![NoeudRouge](https://avatars.discourse-cdn.com/v4/letter/n/13edae/32.png) [@NoeudRouge](https://discourse.nodered.org/u/NoeudRouge)\
**Post date:** [20 May 2021 11:11 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868/28 "2021-05-20T11:11:08Z")

</div>

In fact, considering the fact that the very purpose of the flow is to open the front door I need to have some check to make sure whether the door is open or closed. That is a minimum. Don't you think? 🙂

---

<div class="post-metadata">

**Author:** ![Ranki](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ranki/32/41282_2.png) [@Ranki](https://discourse.nodered.org/u/Ranki)\
**Post date:** [20 May 2021 11:21 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868/29 "2021-05-20T11:21:06Z")

</div>

Hello @NoeudRouge,

I agree, the question is, if the device will tell you that or if you need to scrape this information from another page 🙂  
To be honest, I am lost now with ideas and as I cannot test it on my own system, I think I cannot try to help anymore. The only thing I would have tested (but w/o an idea, if it helps) is to set the headers  
`msg.headers["content-type"] = "application/x-wwww-form-urlencoded"` to have the data transmitted as form.

Cheers and good luck!

Ranki

---

<div class="post-metadata">

**Author:** ![NoeudRouge](https://avatars.discourse-cdn.com/v4/letter/n/13edae/32.png) [@NoeudRouge](https://discourse.nodered.org/u/NoeudRouge)\
**Post date:** [20 May 2021 11:28 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868/30 "2021-05-20T11:28:46Z")

</div>

I will try some other combinations including your proposal.  
Tbh at some time I will need to stop testing because each time I send the http request I need to jump, run and go to my front door to close it. Which is good for my health but not very productive in terms of time.  
Again, thank you for your time and the one of Steve.  
I really appreciated your support.  
Cheers,

Sined

---

<div class="post-metadata">

**Author:** ![Ranki](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ranki/32/41282_2.png) [@Ranki](https://discourse.nodered.org/u/Ranki)\
**Post date:** [20 May 2021 12:45 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868/31 "2021-05-20T12:45:43Z")

</div>

🙃 You cannot close it remotely?

---

<div class="post-metadata">

**Author:** ![Ianmidd](https://avatars.discourse-cdn.com/v4/letter/i/67e7ee/32.png) [@Ianmidd](https://discourse.nodered.org/u/Ianmidd)\
**Post date:** [27 May 2021 19:24 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868/32 "2021-05-27T19:24:14Z")

</div>

First of all, I solved this once before about 2 years ago. I called WebRelay and they gave me a variation on the command. Instead of "state.xml" it was something like "superstate" or "advstate" but I can't remember any more. I tried both of these and its not quite right.

Anyway, if you just want to change the RelayState, the workaround is to use the "Catch" Node. This will trap the error and prevent the flow from crashing. You still get the error but you just throw it away. The WebRelay reacts correctly anyway.

If you want to Read the RelayState then you will need to check with WebRelay themselves.

---

<div class="post-metadata">

**Author:** ![Ianmidd](https://avatars.discourse-cdn.com/v4/letter/i/67e7ee/32.png) [@Ianmidd](https://discourse.nodered.org/u/Ianmidd)\
**Post date:** [27 May 2021 19:41 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868/33 "2021-05-27T19:41:14Z")

</div>

UPDATE: Just got an email back from them and I remember now!!

Try "stateFull.xml" instead of "state.xml". Capital "F" essential.

Its because the WebRelay server code supports an old HTTP version.

---

<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:** [26 July 2021 19:42 UTC](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868/34 "2021-07-26T19:42:00Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/getting-error-parse-error-expected-http-hpe-invalid-constant/45868.md?page=1)
