Hello, after hours of testing and experimenting I just have to accept that these API commands are too complicated for me. I hope someone can help.
I use Windows and Kodi 17.6 (dsplayer).
I want to stop playback with cmd (or powershell script etc.) before I close kodi.
I got this far, this url will work:
http://user:pass@localhost:9696/jsonrpc?request={"jsonrpc":"2.0","id":"1","method":"Player.Stop","params":{"playerid":1}}
But I have no idea how to send this command with cmd or powershell without opening a browser. I have downloaded curl but I can't figure out the syntax, it always errors out one way or the other. I would appreciate the help. As a bonus, api command to exit kodi would also be useful, taskkill /f is not very graceful.
Edit: Could not let it go and finally found an answer. Curl in windows needs extra backslashes. In case someone else happens to be searching
how to stop kodi playback with windows cmd the following works for me:
curl -X POST -H "content-type:application/json"
http://user:pass@localhost:9696/jsonrpc -d {\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"Player.Stop\",\"params\":{\"playerid\":1}}