What is the best way to send data over the web?

So I have a computer, a webserver and a lego robot. Both the computer and the robot are connected to the internet. So I came up with the idea to control the lego robot with unity. Unity will have some kind of control panel and it will send commands to the robot.

The question is, how do I send those commands.

My idea was taking the data and post it with the http protocol to a php file in my webserver. This php file takes this data and puts it in a file. The robot simultaneously downloads that with the http protocol and then executes the commands.

But im sure there has to be a better way than this weird http flip flop.

I would like some help with this. Thanks.

My idea was taking the data and post it with the http protocol to a php file in my webserver. This php file takes this data and puts it in a file. The robot simultaneously downloads that with the http protocol and then executes the commands.

But im sure there has to be a better way than this weird http flip flop.

There is nothing wrong about that approach, seems you need something similar to a chat system, where the control sends commands, the website stores them and the robots reads the previous list of those. But I’m closing this question as it’s too subjective for UA, try our forums to exchange ideas.