How to use POST rather than HTTP for requests
#1
I'm trying to understand the changes, hopefully i can get some help here.   This was working perviously:

wget http://username:[email protected]:808...pc?request={"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Incoming Call from:","message":" ${URIENCODE(${CALLERID(name)})} ${CALLERID(number)} ","displaytime":15000,"image":"/storage/phone.jpg"},"id":1}"

This would cause the anyone calling to show up on the screen with a phone next to it.  and was a convenient feature so we could decide if we should go get our phone when watching a movie or call back later.

If I understand correctly we have to post, and this can be done (linux) by calling
curl --data "request={"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Incoming Call from:","message":" ${URIENCODE(${CALLERID(name)})} ${CALLERID(number)} ","displaytime":15000},"id":1}" "http://username:[email protected]:8080"

but I must have something wrong, any help would be appreicated
Reply
#2
Spit into own thread rather than clutter the schema changes summary thread.

Correct that for security improvements, for Leia many JSON commands need to be sent via POST rather than HTTP. But sorry I have no idea about POST syntax from Linux, perhaps someone else can help.
Reply
#3
@DarthPug, here is a working example using wget


Code:
wget --user xxx --password xxx http://localhost:8080/jsonrpc --header="Content-Type: application/json"--post-data='{"jsonrpc": "2.0", "method": "Player.Open", "params": { "item":{"file":"special://profile/playlists/music/xxx.xsp" }},"id": 0 }'
Reply
#4
@DaveBlake Apologies, will start seperate thread for other posts.

@enen92 Thanks for setting my on the right path.   For reference in case anyone is wanting to use curl:
Code:
curl --header "Content-Type: application/json" --request POST --data '{"jsonrpc": "2.0", "method": "GUI.ShowNotification", "params": { "title":"The title of your message","message":"the actual message","displaytime":15000,"image":"/storage/emulated/0/DCIM/phone.jpg"},"id": 0 }' http://user:[email protected]:8080/jsonrpc
Reply
#5
Hi,

would some kind soul please guide me how to setup initiating a library scan from a php webpage. Leía just killed this feature in my custom web page.

I have grown accustomed executing many Kodi commands with the old API method from my self hosted web site. I have Kodi running on a couple Intels NUCs running LibreElec.

thank you in advanced.
Reply
#6
Found the solution to my own question  ^^ above ^^^.... I have posted the answer here:

https://forum.kodi.tv/showthread.php?tid...pid2969441

Thank you
Image
Reply

Logout Mark Read Team Forum Stats Members Help
How to use POST rather than HTTP for requests0