简体   繁体   中英

Run JavaScript command on website

I have a home automation system which has a small Linux server and an app to control my lighting system. The problem is that this system is too limited for my use, so I wanted to create a desktop app (Java or C#) to send my own data to the server.

When I log into the webpage, I can just use FireFox' JavaScript console to send the commands. But my question is how I can log into a webpage and send JavaScript data to it programmatically.

I also tried sending the data through a WebSocket or TcpClient, but I have no idea how that works.

You just have to perform the same requests than the browser when you are on the website, that is (most probably) HTTP GET and HTTP POST. It is possible to send the request with any programming language, including JavaScript.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM