# HTTP Control of device on local network - HTTP request POST

**URL:** <https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615>\
**Category:** General\
**Tags:** http-request\
**Created:** [12 November 2021 07:00 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615 "2021-11-12T07:00:17Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkC](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/markc/32/37535_2.png) [@MarkC](https://discourse.nodered.org/u/MarkC)\
**Post date:** [12 November 2021 07:00 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615/1 "2021-11-12T07:00:17Z")

</div>

Hi all,  
I am trying to control a device on my local network via the HTTP request node and POST option - but getting the '404 page not found' error below, regardless what I try:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/c/2c7b9c32c4906252d2f28df7147bc5cd3c9aea03.png)

The control documentation for the device only provides the following instructions for HTTP control:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/8/68c5090c50fcd6c1b68e332edb2dddf4257eb61a.png)

The device is already set to 'HTTP control' and I can successfully read parameters via the HTTP request node and GET option, the issue is only with writing/control (using the POST option).

This is one of the many arrangements that I have tried, but I am guessing a little here based on other examples I have found.

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

I have spent a few hours looking through the Node-RED documentation, various online videos and this forum, but unable to resolve the issue (there is actually not so much info about the POST option) - so would greatly appreciate any pointers.

Many thanks in advance, Mark.

---

<div class="post-metadata">

**Author:** ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)\
**Post date:** [12 November 2021 07:19 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615/2 "2021-11-12T07:19:54Z")

</div>

I have found that if you can access the page from a Web Browser (I can only speak of Chrome or Firefox), go to Web Developer Tools | Network and look at the message sent when you access the page, this will hopefully give some indication of the requirements to access the page (Method, Headers etc.)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 November 2021 08:06 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615/3 "2021-11-12T08:06:59Z")

</div>

Are you sure it has to be a post? Do the docs say that? What happens if you put that URL in a browser?

---

<div class="post-metadata">

**Author:** ![MarkC](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/markc/32/37535_2.png) [@MarkC](https://discourse.nodered.org/u/MarkC)\
**Post date:** [12 November 2021 09:24 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615/5 "2021-11-12T09:24:10Z")

</div>

Hi @Colin thanks for the reply.

No I'm not sure at all that it needs to be a 'post' command, that just seemed logical to me and I saw it used elsewhere - if you have another suggestion I am very willing to try it.

If I put in the URL of `IP/control.html` the following page displays  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/8/58c064891f17a304b8f9f3bd329e82eb6a1ce044.png)

---

<div class="post-metadata">

**Author:** ![MarkC](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/markc/32/37535_2.png) [@MarkC](https://discourse.nodered.org/u/MarkC)\
**Post date:** [12 November 2021 09:33 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615/6 "2021-11-12T09:33:09Z")

</div>

Hi @mudwalker, thanks for the reply and suggestion.  
Yes I can access the web page at `[IP]/control.html` with Chrome browser and access the web developer tools - I have looked under 'Network' and reloaded the page but not too sure what to look for...

These are a few screen images, please let me know if there is anything of interest there.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/2/02da48b90171dd20811a0b6b30689e8fce91d855.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/3/c3f7667b30c05b54928e441ede66873a56265138.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/9/b9f56a6b3ef3820eb6373737467d180e79626a29.png)

Regards, Mark.

---

<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:** [12 November 2021 09:37 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615/7 "2021-11-12T09:37:09Z")

</div>

so did you try it with a GET instead ? using the .../control.html?power=n as per you initial config.

---

<div class="post-metadata">

**Author:** ![MarkC](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/markc/32/37535_2.png) [@MarkC](https://discourse.nodered.org/u/MarkC)\
**Post date:** [12 November 2021 09:43 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615/8 "2021-11-12T09:43:14Z")

</div>

Hi @dceejay, no not for anything on the control page yet, only to retrieve data from the `IP/data.jsn` page. Let me try that now...  
Regards, Mark.

---

<div class="post-metadata">

**Author:** ![MarkC](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/markc/32/37535_2.png) [@MarkC](https://discourse.nodered.org/u/MarkC)\
**Post date:** [12 November 2021 09:47 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615/9 "2021-11-12T09:47:44Z")

</div>

Using the GET command and `IP/control.html?power=n` as the URL I basically get back what is on that web page - see screen image

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/0/c088d4216d33e059286249a1191282dd3ab86227.png)

And if I use only `IP/control.html` as the URL I get exactly the same response back.

---

<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:** [12 November 2021 09:58 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615/10 "2021-11-12T09:58:58Z")

</div>

Well I would expect n to be a number eg of some device or other... read the manual

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 November 2021 10:03 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615/11 "2021-11-12T10:03:34Z")

</div>

> [@MarkC](#):
>
> If I put in the URL of `IP/control.html`

I meant to use the url that the docs say, so `http://IP/control.html?power=n` where n is presumably a number.

---

<div class="post-metadata">

**Author:** ![MarkC](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/markc/32/37535_2.png) [@MarkC](https://discourse.nodered.org/u/MarkC)\
**Post date:** [12 November 2021 10:19 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615/12 "2021-11-12T10:19:08Z")

</div>

Hi @Colin and @dceejay,  
Yes 'n' is the desired power output - a number between 0 and 3000.

I just got it to work with the GET option and entering the desired power direct into the URL. I will make that work dynamically next. What would be the best way, using `{{{payload}}}` in place of `n`?

I actually tried this a little earlier but had no load plugged in, and because of that there was no feedback - the power always remained as 0 (despite receiving the command). Now that I plugged a load in the power as displayed in that page changes (and the load activates).

Thank you both very much, your help is greatly appreciated!

Regards, Mark.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 November 2021 10:27 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615/13 "2021-11-12T10:27:25Z")

</div>

> [@MarkC](#):
>
> What would be the best way, using `{{{payload}}}` in place of `n` ?

Yes, but you can use 2 brackets rather than 3, that's to pass unencoded HTML and you don't need to do that here.

---

<div class="post-metadata">

**Author:** ![MarkC](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/markc/32/37535_2.png) [@MarkC](https://discourse.nodered.org/u/MarkC)\
**Post date:** [12 November 2021 10:34 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615/14 "2021-11-12T10:34:19Z")

</div>

Thank you @TotallyInformation - it's all working nicely and I am happy now! 😀

---

<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 November 2021 10:34 UTC](https://discourse.nodered.org/t/http-control-of-device-on-local-network-http-request-post/53615/15 "2021-11-26T10:34:50Z")

</div>

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