Executing remote script over HTTP via Netlinx?
bob
Posts: 296
Is it possible to execute this line/script from a Nelinx master, directly? Any help highly appreciated! Thanks!
http://192.168.50.80:8080/cgi-bin/misc/misc.cgi?count=1264764330&func=restart_main_ok&SHUTDOWN=
0
Comments
You'll just need some code to call the function to do an IP_CLIEN_OPEN and in the online event call another function to send the request. If you go to the ModPedia section of the forum there are some modules posted that do this. RSSWeather, TiVO, Axis Cam, Digital Loggers, Ping URL etc, etc....
SEND_STRING dvIPQnapServer, "'GET http://',sServer_Addr,':8080/cgi-bin/misc/misc.cgi?count=1264764330&func=restart_main_ok&SHUTDOWN=',$0D"
I opened the connection with
IP_CLIENT_OPEN(dvIPServer.PORT, sServer_Addr, 8080, IP_TCP) // IP_TCP = 1
and it gets to the ONLINE event and also "ip status" shows the connection.
"'GET /cgi-bin/misc/misc.cgi?count=1264764330&func=restart_main_ok&SHUTDOWN= HTTP/1.0',$0D,$0A,$0D,$0A"
You can use any number of tools to sniff HTTP requests from your browser to see what they look like -- Live HTTP Headers for Firefox, Fiddler as a web proxy, or Wireshark.