PDA

View Full Version : JSON info needed



yonu
June 1st, 2013, 11:24 PM
Sorry if this has came up before a search didn't yield very much
I am working on converting everything over to girder in order to to cut down on lag between programs however I have a slight issue I cant find a good example of how to star coding the json in lua scripting

what i am trying to do at least on the first part is connect to this server
192.168.1.4:8082/jsonrpc
and send this command {"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}

I will worry about interpreting responses at a later point.

Thanks,
Yonu

yonu
June 13th, 2013, 05:04 PM
hey does anyone know how to use the socket HTTP Post I cant figure out where to put the data otherwise I have this sorted out

Ron
June 13th, 2013, 05:42 PM
Girder has Lua Socket built in:

http://w3.impa.br/~diego/software/luasocket/http.html

yonu
June 13th, 2013, 09:36 PM
that is actually the guide i have been using however i am not getting the proper response from the server. the problem i am having is in the api manual for xbmc they list {"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1} as beeing the data but I can't seem to get it to work in the lua http