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

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


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.

[{"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

I am using postman to send a response and I set the http to
e7855b77f9faa9e62f2db8cdfa9c440a
but for my post request url. Am I suppose to set it to http://myip:1880/route or my api gateway invoke url?

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

1 Like

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