RESTful Switch - call different URL for on & off

I have a camera that has multiple options that can be called via a GET call (with authentication, but I’ve already figured out how to do that).
I would like to know how I can call different URLs for when a RESTful Switch is turned on or off. Example:
Switch On - GET Camera IP/[option]/enable
Switch Off - GET Camera IP/[option]/disable

You can create a template switch and use separate rest_command definitions for your ‘on’ and ‘off’ commands.

Can you please paste the line codes for this? I’m trying to turn on/off the floodlight of a Dahua camera when motion is detected/cleared. Thanks

Hello all, this topic is old, but I found it because I have the same problem. You haven’t provided a solution so I want to do this for subscribers: First, rest and rest_command do not have separate URLs for sending enable/disable commands. Thus, these types of sensors are not suitable for this task.
Finally, I prefer the command line switch with the curl call. I was able to get the switch state and turn it on or off using separate URLs. Here is the code for such a template:

 - switch:
      unique_id: motion_office
      name: "Office motion detection"
      command_on: "curl"
      command_off: "curl"
      command_state: "curl"
      value_template: '{{ value | regex_search("ACTIVE") }}'