Help getting photon to access website button

I’m trying to create a function on the Photon that access’ a local website (IP Webcam) that has no web API i can call, so i would like my photon to press a button on that local webpage called “Record” and when the photon does not record more motion in the room through the PIR sensor press the “Stop Recording” button.

Might be dead simple but im fresh out of ideas, any tips ?

Try to right click the button and see if your browser has an “Inspect” option.
It may just be a simple form submit, which can be emulated perhaps with basic http auth aswell.

Yes it is a form, but no submit, there are many different buttons with unique outcomes, and the one i would like to use is single record and then stop it manually, is it possible to emulate html id tag execution with basic http on the photon ?

image of the inspect from local website created by the IP Webcam app:
Image of IPWebcam website

found some help in the AJAX commands that runs in the background, so i can just send a HTTP call to IP:8080/startvideo and /stopvideo

Great, then you can use the httpclient lib from the photon.

Having trouble getting it to handle response status.
Seems to be -1 each time..

all parameters of the connection is correct and working, but i keep getting -1 as response even if its working and camera is available on local wifi.

String GetCameraStatus(){
httpStatus.post(status, status_response, headers);
int result = status_response.status;
if(result == -1){
Particle.publish("Camera not available");
return "Camera not available";
} else {
Particle.publish("Camera ready");
return "Camera ready";
}
}

any ideas of what im doing wrong ?