# How to post to nodered http in using lambda and api gateway

**URL:** <https://discourse.nodered.org/t/how-to-post-to-nodered-http-in-using-lambda-and-api-gateway/55089>\
**Category:** General\
**Created:** [12 December 2021 17:29 UTC](https://discourse.nodered.org/t/how-to-post-to-nodered-http-in-using-lambda-and-api-gateway/55089 "2021-12-12T17:29:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aron-Chu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aron-chu/32/52522_2.png) [@Aron-Chu](https://discourse.nodered.org/u/Aron-Chu)\
**Post date:** [12 December 2021 17:29 UTC](https://discourse.nodered.org/t/how-to-post-to-nodered-http-in-using-lambda-and-api-gateway/55089/1 "2021-12-12T17:29:05Z")

</div>

I was wanting to post a single string to nodered but was just wondering if I needed to do something special like formatting to msg.payload or using the change node. Quite new to nodered so was just wanting to get pointed in the right direction  
\*\* removed my api url

 ![0d6747b13b78a91f3f8674a330c2797a](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/7/171cc567eaf304b816de54ed32fd7e18b42b121a.png)  
 ![136f7a95023725569404124b522a62ce](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/6/b657ad8494988f1b51d8985a88c872c77639ad5b.png)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [12 December 2021 17:55 UTC](https://discourse.nodered.org/t/how-to-post-to-nodered-http-in-using-lambda-and-api-gateway/55089/2 "2021-12-12T17:55:14Z")

</div>

You will need to send content type header so the http in node know what to do with the data, "text/plain" (which i think is default when no content-type header is sent) should do if sending a string. The http in node should always be paired with a respose node, so the server sending the post request gets a response.  
You should also make sure the msg.res from the in node makes it to the response node.  
So it should be pretty straight forward  
eg.

```auto
[{"id":"85f9cdf8.049d78","type":"http in","z":"c791cbc0.84f648","name":"","url":"/route","method":"post","upload":false,"swaggerDoc":"","x":550,"y":1200,"wires":[["88661335.9b3708","7a99d991.b5837"]]},{"id":"88661335.9b3708","type":"http response","z":"c791cbc0.84f648","name":"","statusCode":"","headers":{},"x":760,"y":1160,"wires":[]},{"id":"7a99d991.b5837","type":"debug","z":"c791cbc0.84f648","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":760,"y":1260,"wires":[]}]

```

the request url would be  
`http://ip:1880/route`

---

<div class="post-metadata">

**Author:** ![Aron-Chu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aron-chu/32/52522_2.png) [@Aron-Chu](https://discourse.nodered.org/u/Aron-Chu)\
**Post date:** [12 December 2021 18:27 UTC](https://discourse.nodered.org/t/how-to-post-to-nodered-http-in-using-lambda-and-api-gateway/55089/3 "2021-12-12T18:27:26Z")

</div>

I am using postman to send a response and I set the http to  
 ![e7855b77f9faa9e62f2db8cdfa9c440a](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/d/7d7e7781a33f987f90a8253c93c2d80f2d7d0d13.png)  
but for my post request url. Am I suppose to set it to [http://myip:1880/route](http://myip:1880/route) or my api gateway invoke url?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [12 December 2021 18:40 UTC](https://discourse.nodered.org/t/how-to-post-to-nodered-http-in-using-lambda-and-api-gateway/55089/4 "2021-12-12T18:40:27Z")

</div>

If you are trying to send a string to node red you will need to post to `http://myip:1880/route`

---

<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 December 2021 18:40 UTC](https://discourse.nodered.org/t/how-to-post-to-nodered-http-in-using-lambda-and-api-gateway/55089/5 "2021-12-26T18:40:56Z")

</div>

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