Dear @RRodman@april.brandt@markus … I would like to test my generic rest server .
How can I PUT some content to a NR implemented endpoint ?
Have I to use an “http in” node ? Which is the url to reach my core NR (that is which ip and port I have to send the data to, being core a container?)
What I have done:
I wrote a simple rest manager in python.
I changed oll-node-red.conf file adding:
PORT MAP+=(“192.168.xxx.yyy:9000:1880”)
where 192.168.xxx.yyy is my core IP and 1880 should be the port of "HTTP in’ node in NR, if I’m not wrong
I created a flow with an HTTP in node method=GET and url=/put.
I send my REST commands to ‘http://192.168.xxx.yyy:9000//put’
I get the following response:
the NR Http-in node must match the invoked method: if I am calling a PUT, the node has to declare method=PUT (instead of GET). Trivial but time wasting!
Of course should you want to query the NR node, the method must be GET.
The other settings (port mapping) are ok.
To test, I used a curl format allowing the Http-in node to receive a json structure to be used directly inside a nodered message (remember web browser allows only GET commands to be issued; if you want send a PUT command, you must use curl or similar):
curl -X PUT -H "Content-Type: application/json" -d " {\"sender_id\":\"1\",\"sender_name\":\"SW_STANZINO\"}" http://192.168.xxx.yyy:9000/pods/direct/node-red/put
Have a look to the following link (be warned it Is an example of a GET implementation)