HTTP GET to ESP32

Hello, I'm new with Arduino.
Could someone help me with the code below:

curl 'http://192.168.0.1/cgi?5' -H 'Referer: http://192.168.0.1/mainFrame.htm' -H 'Cookie: Authorization=Basic XXXXXXXXXX' --data-binary 

I want to "translate" this code to use in my ESP32,
If the MAC address matches with XXX or YYY low relay
If the MAC address does not match with XXX and YYY high relay

I use this command on an Android with Tasker to find out if my wife or I are at home and turn the alarm system on or off.[LAN_HOST_ENTRY#0,0,0,0,0,0#0,0,0,0,0,0]0,1\r\nMACAddress\r\n'


I want to "translate" this code to use in my ESP32,
If the MAC address matches with XXX or YYY low relay
If the MAC address does not match with XXX and YYY high relay

I use this command on an Android with Tasker to find out if my wife or I are at home and turn the alarm system on or off.

I would not let m’y home security rely on an Esp or something like this but it has a few safeguards (attacker would neeed to be within the LAN and know a valid MAC address)

Otherwise just setup your ESP on your WiFi network with the 192.168.0.1 address (isn’t that your router ?) and write a small piece of code printing the HTTP header you receive - you should see your data. (see the SimpleWiFiServer example and have your relay connected instead of a LED, adding your checks)