Start kodi service en stop kodi service by http call


I’am new to HA. I think I have a simple question…
I have a raspberry with MAX2play installed.
I use this to listen music or watching movies. To do this I have to start en stop the kodi services. This is simpely done by a http command like:

Now I want to make a switch so i can use it in my automations. Could someone help me with this.
I tried this already but HA didn’t accept the config.

> switch:
>   - platform: command_line
>     switches:
>         Kodi:
>         command_on: 'curl -k ""'
>         command_off: 'curl -k ""'

It could be an indentation error.
Please repost your configuration surrounded by three back ticks (check guide if unsure) to keep spacing and formatting as in the configuration file.