Hi @Hootie81,
Sounds cool! I expanded on a previous post where I talked about making http POST / http GET requests, here’s a nicer version with http basic auth (from your url):
//how to call
httpGetRequest("192.168.1.10", 80,
"/jsonrpc?request={%22jsonrpc%22:%222.0%22,%22method%22:%22Addons.ExecuteAddon%22,%22params%22:{%22addonid%22:%22script.securitycam%22},%22id%22:%221%22}}",
"username","password");
}
//the wrapper
void httpGetRequest(char *hostname, int port, char *url, char *username, char *password) {
TCPClient client;
client.connect(hostname, port);
client.print("GET ");
client.print(url);
client.println("HTTP/1.0");
client.print("Host: ");
client.println(hostname);
if (username != NULL) {
//NOTE! make sure username and password are already base64 encoded here!
client.print("Authorization: Basic ");
client.print(String(username) + String(":") + String(password));
}
client.println("Content-Length: 0");
client.println();
client.flush();
client.stop();
delay(250);
}
Thanks!
David