# Empty reply from server - creating an HTTP Endpoint

**URL:** <https://discourse.nodered.org/t/empty-reply-from-server-creating-an-http-endpoint/64817>\
**Category:** General\
**Created:** [8 July 2022 07:00 UTC](https://discourse.nodered.org/t/empty-reply-from-server-creating-an-http-endpoint/64817 "2022-07-08T07:00:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harpau](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/harpau/32/8425_2.png) [@Harpau](https://discourse.nodered.org/u/Harpau)\
**Post date:** [8 July 2022 07:00 UTC](https://discourse.nodered.org/t/empty-reply-from-server-creating-an-http-endpoint/64817/1 "2022-07-08T07:00:38Z")

</div>

I am trying to create an HTTP Endpoint using the description provided here: [https://cookbook.nodered.org/http/create-an-http-endpoint](https://cookbook.nodered.org/http/create-an-http-endpoint)  
Using the example code together with the mentioned curl-command I get the reply "curl: (52) Empty reply from server".  
I am using a Debian operated local system an I have installed node-red using the description provided here: [https://nodered.org/docs/getting-started/raspberrypi](https://nodered.org/docs/getting-started/raspberrypi)  
What am I doing wrong?  
Many thanks!

---

<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:** [8 July 2022 07:28 UTC](https://discourse.nodered.org/t/empty-reply-from-server-creating-an-http-endpoint/64817/2 "2022-07-08T07:28:30Z")

</div>

> [@Harpau](#):
>
> What am I doing wrong?

Difficult to say without more info...

- Share your flow
- Share your curl command

  

NOTE: Please wrap code in a code fence to avoid forum formatting making flow/curl command unusable.  
`````  
`like this, between back ticks`  
`````

---

<div class="post-metadata">

**Author:** ![Harpau](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/harpau/32/8425_2.png) [@Harpau](https://discourse.nodered.org/u/Harpau)\
**Post date:** [8 July 2022 08:08 UTC](https://discourse.nodered.org/t/empty-reply-from-server-creating-an-http-endpoint/64817/3 "2022-07-08T08:08:50Z")

</div>

I am using 1:1 the example provided here: [https://cookbook.nodered.org/http/create-an-http-endpoint](https://cookbook.nodered.org/http/create-an-http-endpoint)

Flow: `[{ "id": "8fb7704d922a7884", "type": "tab", "label": "Flow 1", "disabled": false, "info": "", "env": [] }, { "id": "59ff2a1.fa600d4", "type": "http in", "z": "8fb7704d922a7884", "name": "", "url": "/hello", "method": "get", "swaggerDoc": "", "x": 100, "y": 180, "wires": [[ "54c1e70d.ab3e18"] ] }, { "id": "54c1e70d.ab3e18", "type": "template", "z": "8fb7704d922a7884", "name": "page", "field": "payload", "fieldType": "msg", "format": "handlebars", "syntax": "mustache", "template": "<html>\n <head></head>\n <body>\n <h1>Hello World!</h1>\n </body>\n</html>", "x": 250, "y": 180, "wires": [[ "266c286f.d993d8"] ] }, { "id": "266c286f.d993d8", "type": "http response", "z": "8fb7704d922a7884", "name": "", "x": 390, "y": 180, "wires": [] } ]`

URL command: `root@nodered:~# curl http://localhost:1880/hello curl: (52) Empty reply from server root@nodered:~# `

---

<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:** [8 July 2022 08:12 UTC](https://discourse.nodered.org/t/empty-reply-from-server-creating-an-http-endpoint/64817/4 "2022-07-08T08:12:56Z")

</div>

What you have posted works perfectly fine for me...

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

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

Question...

- Why are you running `curl` as `root` user?
- Are you using the `node-red-start` command to start node-red
  - in other words, what user is running node-red? If you used the installer script, then it would be installed as PI or the user you initially ran the script as.

---

<div class="post-metadata">

**Author:** ![Harpau](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/harpau/32/8425_2.png) [@Harpau](https://discourse.nodered.org/u/Harpau)\
**Post date:** [8 July 2022 08:34 UTC](https://discourse.nodered.org/t/empty-reply-from-server-creating-an-http-endpoint/64817/5 "2022-07-08T08:34:38Z")

</div>

Many thanks for your help!

> [@Steve-Mcl](#):
>
> Why are you running `curl` as `root` user?

No special reason for this. Simply because I log on to the machine via SSH as root@...

> [@Steve-Mcl](#):
>
> Are you using the `node-red-start` command to start node-red
> 
> - in other words, what user is running node-red? If you used the installer script, then it would be installed as PI or the user you initially ran the script as.

I have installed Node-Red as root and as described here: [Running on Raspberry Pi : Node-RED (nodered.org)](https://nodered.org/docs/getting-started/raspberrypi)  
I run Node-Red as a service and I have enabled Autostart on boot as described in the above document with the following command: `sudo systemctl enable nodered.service`

---

<div class="post-metadata">

**Author:** ![Harpau](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/harpau/32/8425_2.png) [@Harpau](https://discourse.nodered.org/u/Harpau)\
**Post date:** [8 July 2022 12:51 UTC](https://discourse.nodered.org/t/empty-reply-from-server-creating-an-http-endpoint/64817/6 "2022-07-08T12:51:32Z")

</div>

I have tried now not to start node-red as a service but to start manually as root: Same result.  
I also have tried to change port 1880 to 80 in the settings file: Same result too.  
Where else can I look? I am very grateful for any help!

---

<div class="post-metadata">

**Author:** ![Harpau](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/harpau/32/8425_2.png) [@Harpau](https://discourse.nodered.org/u/Harpau)\
**Post date:** [8 July 2022 13:45 UTC](https://discourse.nodered.org/t/empty-reply-from-server-creating-an-http-endpoint/64817/7 "2022-07-08T13:45:16Z")

</div>

The problem seems to be in the settings for https: As soon as I specify a "key" and a "cert" under "https", the Node-Red server only accepts https connections, even if I set "requireHttps" to "false".  
Is this the way it should be?

---

<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:** [6 September 2022 13:45 UTC](https://discourse.nodered.org/t/empty-reply-from-server-creating-an-http-endpoint/64817/8 "2022-09-06T13:45:37Z")

</div>

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