# Red HttpRequest node status in case of code 4xx and 5xx

**URL:** <https://discourse.nodered.org/t/red-httprequest-node-status-in-case-of-code-4xx-and-5xx/4132>\
**Category:** Feature Requests\
**Created:** [19 October 2018 22:06 UTC](https://discourse.nodered.org/t/red-httprequest-node-status-in-case-of-code-4xx-and-5xx/4132 "2018-10-19T22:06:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [19 October 2018 22:06 UTC](https://discourse.nodered.org/t/red-httprequest-node-status-in-case-of-code-4xx-and-5xx/4132/1 "2018-10-19T22:06:13Z")

</div>

Hi folks,

When the httprequest node gets a 401 ( **unauthorised** ), the node status doesn't mention this problem. Instead it displays '_requesting_'.

You can only see that there is something wrong, by having a look at the `msg.statusCode` or the `msg.payload`:

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

I find it very confusing that I don't see in the node status that something went wrong.  
Personnally I would expect a red node status in case the status is **4xx** (Client Error) or **5xx** (Server Error).

Any suggestions, ideas about this ?

Thanks again !  
Bart

---

<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:** [19 October 2018 22:38 UTC](https://discourse.nodered.org/t/red-httprequest-node-status-in-case-of-code-4xx-and-5xx/4132/2 "2018-10-19T22:38:27Z")

</div>

Bart,

not sure why your node status is stuck on `requesting`. The node sets that status when [a message is received](https://github.com/node-red/node-red/blob/5cf9c07b7332869a108fb1a3d39ae29b16580d68/nodes/core/io/21-httprequest.js#L46) but it clears it when it [finishes processing the response](https://github.com/node-red/node-red/blob/5cf9c07b7332869a108fb1a3d39ae29b16580d68/nodes/core/io/21-httprequest.js#L252).

The node already does set the status for other errors - such as timeouts and dns failures etc. The problem with displaying the 4xx/5xx statuses is that the node sends on a message in those cases - with `statusCode` set properly. If we start updating status as well, then anyone using a Status node to monitor the request node will start getting extra messages from the Status node in those cases that they will already be handling out of the node's normal output.

I'm not sure how much of risk that is; but it needs considering. And as I mentioned in the other thread, its the wrong time on a Friday night to think too much about it.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [20 October 2018 09:56 UTC](https://discourse.nodered.org/t/red-httprequest-node-status-in-case-of-code-4xx-and-5xx/4132/3 "2018-10-20T09:56:06Z")

</div>

> [@knolleary](#):
>
> why your node status is stuck on `requesting`

Did the test again, and the node status is indeed cleared automatically afterwards. Perhaps it was the wrong time on a Friday night to test such a feature ...

> [@knolleary](#):
>
> anyone using a Status node to monitor the request node will start getting extra messages from the Status node in those cases that they will already be handling out of the node's normal output

Never used the Status node, but I can image that - when somebody uses it to monitor the HttpRequest node - they want to be warned when e.g. an _ **unauthorised** _ problem occurs? Or perhaps I'm misinterpreting the usage of that Status 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:** [20 October 2018 14:08 UTC](https://discourse.nodered.org/t/red-httprequest-node-status-in-case-of-code-4xx-and-5xx/4132/4 "2018-10-20T14:08:17Z")

</div>

They will be notified beacause the normal msg sent by the request node will have all the details.

---

<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:** [20 October 2018 15:49 UTC](https://discourse.nodered.org/t/red-httprequest-node-status-in-case-of-code-4xx-and-5xx/4132/5 "2018-10-20T15:49:13Z")

</div>

The status tells you the status of the node itself. If the node is working then the actual return code is in the msg returned

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [20 October 2018 19:03 UTC](https://discourse.nodered.org/t/red-httprequest-node-status-in-case-of-code-4xx-and-5xx/4132/6 "2018-10-20T19:03:28Z")

</div>

> [@dceejay](#):
>
> The status tells you the status of the node itself. If the node is working then the actual return code is in the msg returned

Ok thanks for explaining. Will keep that in mind...
