Working with JSON or XML v2

hello agian

the last tread got closed.

i got the unit to upload the file xml to a server, and i can read the file.
But can i send it directly in to node red, instead read a file on a server?
This is the unit that i am trying the connect to and control.

You may be able to, depending on how Node-RED is configured and how accessible it is. Whether you should may be another matter. But that is up to how secure you want things and how you have configured node-red.

The node red installation is exposed on high port number, and behind a DPI firewall with access log.
Right now, the xml is sitting a open web server for test purposes.

I having trouble understanding which nod i should use for end point and how is i differentiate between the different units that are sending the file.
All in all, i have about 15 units.

the configuration pages looks like this on the unit:

You need a combination of an http-in and http-out node. The -in node must listen for POST requests and the -out must send a simple response back so that the sending app knows that it has succeeded.

If the JSON data contains an identifier for the unit then you just need to process that in the flow. If not, then you need to set the URL for the -in node to have something like /:unit on the end and use a unique URL in each post page that ends in the unit id.

http://<node-red-address>:<port>/<http-in-url>/<unit>

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