# Can't POST from local machine

**URL:** <https://discourse.nodered.org/t/cant-post-from-local-machine/44923>\
**Category:** General\
**Created:** [29 April 2021 10:02 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923 "2021-04-29T10:02:31Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheHam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/theham/32/40973_2.png) [@TheHam](https://discourse.nodered.org/u/TheHam)\
**Post date:** [29 April 2021 10:02 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/1 "2021-04-29T10:02:31Z")

</div>

I have this flow that works nicely when I try to access the HTTP IN node via an external machine

```auto
curl "http://192.168.50.59:1880/callback_google_meet_url" -X POST -d "test"

```

However, if I try connect it locally it doesn't work:

```auto
curl "http://localhost:1880/callback_google_meet_url" -X POST -d "test"

```

or

```auto
curl "http://127.0.0.1:1880/callback_google_meet_url" -X POST -d "test"

```

I just got this error message:

```auto
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /calback_google_meet_url</pre>
</body>
</html>

```

Here's the flow that I'm using

```auto
[{"id":"6bf330e3.7c886","type":"tab","label":"Debug","disabled":false,"info":""},{"id":"f2ba6c03.8e3da","type":"http in","z":"6bf330e3.7c886","name":"Callback with the Google Meet URL","url":"callback_google_meet_url","method":"post","upload":false,"swaggerDoc":"","x":500,"y":340,"wires":[["bc26fc08.625b4","f7130f73.285d2"]]},{"id":"bc26fc08.625b4","type":"debug","z":"6bf330e3.7c886","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":850,"y":400,"wires":[]},{"id":"f7130f73.285d2","type":"http response","z":"6bf330e3.7c886","name":"","statusCode":"","headers":{},"x":830,"y":280,"wires":[]}]

```

---

<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:** [29 April 2021 10:08 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/2 "2021-04-29T10:08:18Z")

</div>

silly question (but someone has to ask) ...

is the `curl` command being executed on the same machine that node-red is running on?

does the debug show anthing when you curl to `localhost`?

can you change the debug to show complete msg - do you see clues in the full msg object?

---

<div class="post-metadata">

**Author:** ![TheHam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/theham/32/40973_2.png) [@TheHam](https://discourse.nodered.org/u/TheHam)\
**Post date:** [29 April 2021 10:16 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/3 "2021-04-29T10:16:57Z")

</div>

I'm executing them on different machines:

Node-red machine: `curl "http://localhost:1880/callback_google_meet_url" -X POST -d "test"`  
other machine: `curl "http://192.168.50.59:1880/callback_google_meet_url" -X POST -d "test"`

No debug for the local curl, event with the complete message

I also changed the http response code for 200 on the response node just in case

---

<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:** [29 April 2021 10:17 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/4 "2021-04-29T10:17:52Z")

</div>

> [@TheHam](#):
>
> I'm executing them on different machines

localhost wont work if you are not on the node-red machine - am i misunderstanding you?

---

<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:** [29 April 2021 10:22 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/5 "2021-04-29T10:22:50Z")

</div>

Are you running node-red in a container such as Docker?

---

<div class="post-metadata">

**Author:** ![TheHam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/theham/32/40973_2.png) [@TheHam](https://discourse.nodered.org/u/TheHam)\
**Post date:** [29 April 2021 10:23 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/6 "2021-04-29T10:23:35Z")

</div>

Oh no, I'm not that dumb 😃

The localhost curl is being executed locally on the raspberry pi where node-red is installed

---

<div class="post-metadata">

**Author:** ![TheHam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/theham/32/40973_2.png) [@TheHam](https://discourse.nodered.org/u/TheHam)\
**Post date:** [29 April 2021 10:27 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/7 "2021-04-29T10:27:54Z")

</div>

> Are you running node-red in a container such as Docker?

No, I'm not using a container

---

<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:** [29 April 2021 10:28 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/8 "2021-04-29T10:28:50Z")

</div>

What does  
`curl "http://localhost:1880/"`  
show?

---

<div class="post-metadata">

**Author:** ![TheHam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/theham/32/40973_2.png) [@TheHam](https://discourse.nodered.org/u/TheHam)\
**Post date:** [29 April 2021 10:37 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/9 "2021-04-29T10:37:38Z")

</div>

```auto
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<!--
  Copyright JS Foundation and other contributors, http://js.foundation

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<title>Node-RED</title>
<link rel="icon" type="image/png" href="favicon.ico">
<link rel="mask-icon" href="red&#x2F;images&#x2F;node-red-icon-black.svg" color="#8f0000">
<link rel="stylesheet" href="vendor/jquery/css/base/jquery-ui.min.css">
<link rel="stylesheet" href="vendor/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="red/style.min.css">
</head>
<body spellcheck="false">
<div id="red-ui-editor"></div>
<script src="vendor/vendor.js"></script>
<script src="red&#x2F;red.min.js"></script>
<script src="red&#x2F;main.min.js"></script>

</body>
</html>

```

---

<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:** [29 April 2021 10:42 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/10 "2021-04-29T10:42:15Z")

</div>

That's ok then, it is very odd, your flow works for me. Either you have something blocking POST to localhost or it is an issue with node-red. What hardware/OS are you running on and what version of node-red and nodejs. The node-red version is at the bottom of the dropdown menu, you can get the nodejs version using  
`node -v`

---

<div class="post-metadata">

**Author:** ![TheHam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/theham/32/40973_2.png) [@TheHam](https://discourse.nodered.org/u/TheHam)\
**Post date:** [29 April 2021 10:45 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/11 "2021-04-29T10:45:27Z")

</div>

Rasbian running on a Raspberry Pi 4B 4gb

Node: v12.22.1  
Node-red: v1.3.3

---

<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:** [29 April 2021 10:51 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/12 "2021-04-29T10:51:19Z")

</div>

That should be ok. Does it work if you change it to a GET?

---

<div class="post-metadata">

**Author:** ![TheHam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/theham/32/40973_2.png) [@TheHam](https://discourse.nodered.org/u/TheHam)\
**Post date:** [29 April 2021 11:46 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/13 "2021-04-29T11:46:25Z")

</div>

No, same thing.

---

<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:** [29 April 2021 12:30 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/14 "2021-04-29T12:30:14Z")

</div>

So having changed it to a GET  
`curl "http://localhost:1880/"`  
works, but  
`curl "http://localhost:1880/callback_google_meet_url"`  
doesn't? Even though you are definitely running the curl command directly on the machine running node-red.

When you run the node-red editor in a browser which machine are you running the browser on and what URL are you using in the browser?

---

<div class="post-metadata">

**Author:** ![TheHam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/theham/32/40973_2.png) [@TheHam](https://discourse.nodered.org/u/TheHam)\
**Post date:** [29 April 2021 12:33 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/15 "2021-04-29T12:33:31Z")

</div>

For speed reasons I use a remote machine, but it works on both.

BTW I've installed a fresh copy of rasbian and node-red and it's now working. No idea on why it wasn't before though

Thank you for your help \<3

---

<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:** [28 June 2021 12:33 UTC](https://discourse.nodered.org/t/cant-post-from-local-machine/44923/16 "2021-06-28T12:33:33Z")

</div>

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