# Http in receive a post

**URL:** <https://discourse.nodered.org/t/http-in-receive-a-post/49808>\
**Category:** General\
**Created:** [16 August 2021 21:09 UTC](https://discourse.nodered.org/t/http-in-receive-a-post/49808 "2021-08-16T21:09:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zamzon](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zamzon/32/15521_2.png) [@zamzon](https://discourse.nodered.org/u/zamzon)\
**Post date:** [16 August 2021 21:09 UTC](https://discourse.nodered.org/t/http-in-receive-a-post/49808/1 "2021-08-16T21:09:45Z")

</div>

Hi

I need to receive data from a datalogger, it post the data every 15min.  
But how do i set this up in NodeRED.

Do I need to install a webserver or can i use port 1880 ?

I also did try to make a test to see if it works, but i cant get it working

![node red](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/c/0cdea551980cd13c3ae75c0e269421ffb5eabe0d.jpeg)

```auto
[{"id":"809c6e4af24655b1","type":"tab","label":"Http in from ATK3","disabled":false,"info":""},{"id":"160ea475ba39bb74","type":"http in","z":"809c6e4af24655b1","name":"","url":"/post_data","method":"post","upload":true,"swaggerDoc":"","x":290,"y":180,"wires":[["4725c1881252c090"]]},{"id":"4725c1881252c090","type":"debug","z":"809c6e4af24655b1","name":"Input from /post_data","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":680,"y":180,"wires":[]},{"id":"5a23c204f4749839","type":"inject","z":"809c6e4af24655b1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":310,"y":340,"wires":[["17dab0a5f7d8c1e3"]]},{"id":"17dab0a5f7d8c1e3","type":"http request","z":"809c6e4af24655b1","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"/post_data","tls":"","persist":false,"proxy":"","authType":"","x":710,"y":340,"wires":[["86a399a274601254"]]},{"id":"86a399a274601254","type":"debug","z":"809c6e4af24655b1","name":"Test message","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":340,"wires":[]}]

```

 ![22](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/4/54e293a233e6aaa87db9574628a24fa605b684cb.jpeg)

---

<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:** [16 August 2021 21:12 UTC](https://discourse.nodered.org/t/http-in-receive-a-post/49808/2 "2021-08-16T21:12:07Z")

</div>

> [@zamzon](#):
>
> Do I need to install a webserver

No

> [@zamzon](#):
>
> or can i use port 1880 ?

yes

> [@zamzon](#):
>
> But how do i set this up in NodeRED.

you need to have a http in **and** a http response to make a callable endpoint.

see http endpoints in the cookbook: [Node-RED Cookbook : Node-RED](https://cookbook.nodered.org/#http-endpoints)

---

<div class="post-metadata">

**Author:** ![zamzon](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zamzon/32/15521_2.png) [@zamzon](https://discourse.nodered.org/u/zamzon)\
**Post date:** [16 August 2021 21:25 UTC](https://discourse.nodered.org/t/http-in-receive-a-post/49808/3 "2021-08-16T21:25:44Z")

</div>

Hi

Could this work?

```auto
[{"id":"809c6e4af24655b1","type":"tab","label":"Http in from ATK3","disabled":false,"info":""},{"id":"4725c1881252c090","type":"debug","z":"809c6e4af24655b1","name":"Input from /post_data","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":820,"y":80,"wires":[]},{"id":"5a23c204f4749839","type":"inject","z":"809c6e4af24655b1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":310,"y":340,"wires":[["17dab0a5f7d8c1e3"]]},{"id":"17dab0a5f7d8c1e3","type":"http request","z":"809c6e4af24655b1","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"/post_data","tls":"","persist":false,"proxy":"","authType":"","x":710,"y":340,"wires":[["86a399a274601254"]]},{"id":"86a399a274601254","type":"debug","z":"809c6e4af24655b1","name":"Test message","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":340,"wires":[]},{"id":"0cb50556d32733f4","type":"comment","z":"809c6e4af24655b1","name":"Test to post something","info":"","x":330,"y":280,"wires":[]},{"id":"8d9c24833c6bcb1f","type":"comment","z":"809c6e4af24655b1","name":"Receive a post from my datalogger","info":"","x":360,"y":120,"wires":[]},{"id":"3e1c5107.c1e3ae","type":"http in","z":"809c6e4af24655b1","name":"","url":"/post_data","method":"post","upload":false,"swaggerDoc":"","x":380,"y":180,"wires":[["cf679478.309868","4725c1881252c090"]]},{"id":"cf679478.309868","type":"template","z":"809c6e4af24655b1","name":"page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n <head></head>\n <body>\n <h1>OK</h1>\n </body>\n</html>","x":630,"y":180,"wires":[["f3c1a3f0.0c3e6","4725c1881252c090"]]},{"id":"f3c1a3f0.0c3e6","type":"http response","z":"809c6e4af24655b1","name":"","statusCode":"","headers":{},"x":810,"y":180,"wires":[]}]

```

How do I get the data from my logger?

---

<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:** [16 August 2021 21:33 UTC](https://discourse.nodered.org/t/http-in-receive-a-post/49808/4 "2021-08-16T21:33:03Z")

</div>

> [@zamzon](#):
>
> How do I get the data from my logger?

No idea, you havent said what kind of logger, not provided any links or documentation.

Looking at your 1st screen shot, the logger will call your endpoint (every 15m) - and will likely pass in the data (probably in msg.payload) - use the debug node to identify where the data comes in.

Once you see data come in, you can then figure out what to do with it.

is it JSON data? CSV Data? What do you want to do with this data? etc etc

PS, the HTTP request is not necessary - that is for calling an endpoint.

---

<div class="post-metadata">

**Author:** ![zamzon](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zamzon/32/15521_2.png) [@zamzon](https://discourse.nodered.org/u/zamzon)\
**Post date:** [16 August 2021 21:39 UTC](https://discourse.nodered.org/t/http-in-receive-a-post/49808/5 "2021-08-16T21:39:23Z")

</div>

I haven't used the http node before.  
but i did recevice data on my old server, and here I received this

```auto
https://meterreadings.keepfocus.dk/electrocom/post_data?data=11848423&time=2070/
01/01,00:00:55&status=08&d00=1123517!36E@36850!36E@1060317!36E@39878!36E@11154!3
6E@204031!36E@5898984!36E@0!36E:11848423&d01=4B895026!404:00505912&d02=4A9D7CF4!
404:00507901&d03=4A42B8C8!404@0!37F@0!37F@0!37F@0!37F@0!37F@0!37F@0!37F@0!37F:00
039887&d04=482BFF00!404@0!37F@0!37F@0!37F@0!37F@0!37F@0!37F@0!37F@0!37F:00039890
&d05=4897E1E0!404@0!37F@0!37F@0!37F@0!37F@0!37F@0!37F@0!37F@0!37F:00039889&d06=4
AFA449E!404@0!37F@0!37F@0!37F@0!37F@0!37F@0!37F@0!37F@0!37F:00258271&tz=0&fw=1.3
.938&ip=192.168.112.200

```

but it seams that I dont get any data in to node red

---

<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:** [15 October 2021 21:40 UTC](https://discourse.nodered.org/t/http-in-receive-a-post/49808/6 "2021-10-15T21:40:06Z")

</div>

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