How to send REST request to nodered server to set/see message payload

#1

Is there any way to send a REST request to node red and set/see msg.payload?

0 Likes

#2

Hi - yes. There are lots of examples of HTTP endpoints in the cookbook: https://cookbook.nodered.org/http/

0 Likes

#3

Thanks, i appreciate it. Is there any way to pull in a rest request the parameters that a node will accept as input?

0 Likes

#4

Hi - sorry, I'm not entirely sure what you mean by that. The cookbook shows how to pass in parameters etc in the http requests. You can then use a Change node to move those parameters to whatever message property another node expects it to be under.

0 Likes

#5

Alright. Basically what I'm asking is this. Is there a REST endpoint that will allow me to get a list of the parameters the node will accept. As an example, if it processes a name parameter, a color parameter, etc. Is it possible to send a request to see what the node can process. I'm trying to create a UI as another editor and trying to use REST to get info about a node to allow for dragging and dropping in to a list of what the nodes in the flow can process. This way if a node can process an IP, I want to send a request and it says "yeah, this node will accept an IP" and then I can drag/drop an IP in to a window to process. The same goes for output as well preferably.

0 Likes

#6

No - we don't have that information. Node's don't share any metadata about what they accept or send.

0 Likes

#7

Damn, that would be a useful feature. Hopefully something like that gets put in for .20 or .21.

0 Likes