Make URL HEAD request and do action depending on HTTP/1.1 reply


1) Give a description of the problem
I want to make a URL HEAD request to a local IP and run a command based the reply if not 200 then this

2) What is the expected behavior?
turn a switch off and wait 10 seconds and turn back on.


This is my piston…


I think we’re unclear on the question here, can you explain what is not working as expected or with what specific part of this piston you need assistance?


I want to parse the http status code 200 when I use the get HEAD url. If the response is anything but 200 to turn a switch off then on.


Anyone ?

It seems that the piston is getting a 408 http code which can’t be right as I thought it would run this locally ?