Kodi Community Forum
Curl command not working for remote reboot - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Curl command not working for remote reboot (/showthread.php?tid=343464)



Curl command not working for remote reboot - griffindodd - 2019-04-30

I've been staring at this for way too long, can't see why this command isn't working from powershell on windows.

Kodi 18.1 on LibreELEC
Code:
curl.exe -i -X POST -d '{"jsonrpc": "2.0","id": 1,"method": "System.Reboot"}' -H "content-type:application/json" http://kodi:[email protected]:8080/jsonrpc

here's my response
Code:
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 76
Content-Type: application/json
Cache-Control: private, max-age=0, no-cache
Accept-Ranges: none
Date: Mon, 29 Apr 2019 21:58:29 GMT

{"error":{"code":-32700,"message":"Parse error."},"id":null,"jsonrpc":"2.0"}



RE: Curl command not working for remote reboot - griffindodd - 2019-04-30

Also failed trying this...

Code:
curl.exe -X POST --user kodi:kodi --header 'content-type: application/json' --data-binary '{ "id": 1, "jsonrpc": "2.0", "method": "System.reboot" }' http://10.10.59.58:8080/jsonrpc



RE: Curl command not working for remote reboot - asavah - 2019-04-30

Try System.Reboot (capital R)

Hmm, just tried it myself, works fine from a linux box but fails from windoze , ask MS to fix their crap ))

Edit2: this is powershell problem, try escaping the " with \" in data, like this:
Code:
 curl.exe -X POST --user kodi:kodi --header 'content-type: application/json' --data-binary '{ \"id\": 1, \"jsonrpc\": \"2.0\", \"method\": \"System.Reboot\" }' http://10.10.59.58:8080/jsonrpc
Worked for me.


RE: Curl command not working for remote reboot - griffindodd - 2019-04-30

(2019-04-30, 01:01)asavah Wrote: Try System.Reboot (capital R)

Hmm, just tried it myself, works fine from a linux box but fails from windoze , ask MS to fix their crap ))

Edit2: this is powershell problem, try escaping the " with \" in data, like this:
Code:
 curl.exe -X POST --user kodi:kodi --header 'content-type: application/json' --data-binary '{ \"id\": 1, \"jsonrpc\": \"2.0\", \"method\": \"System.Reboot\" }' http://10.10.59.58:8080/jsonrpc
Worked for me.
Thank you so much , this worked for me!!!