Json Call to remote instance
#1
All
I am trying to make a Json call to an instance of XBMC running on another machine on my network. Below is the code I am using. When I run this I get the following error. Any input would be appreciated.

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

PHP Code:
import urllib
import urllib2

host 
'192.168.0.50'
port '8080'
url 'http://%s:%s/jsonrpc' %(hostport
user_agent 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
values = {"jsonrpc""2.0""method""JSONRPC.Introspect""id""1"}
headers = { 'User-Agent' user_agent }

data urllib.urlencode(values)
req urllib2.Request(urldataheaders)
response urllib2.urlopen(req)
the_page response.read()

file "C:\\test\\test_output.txt"
open(file,"w")
f.write(the_page)
f.close 

Reply


Messages In This Thread
Json Call to remote instance - by DecK - 2012-04-04, 18:11
RE: Json Call to remote instance - by DecK - 2012-04-04, 22:13
RE: Json Call to remote instance - by DecK - 2012-04-05, 02:03
RE: Json Call to remote instance - by jbel - 2012-04-05, 04:06
RE: Json Call to remote instance - by DecK - 2012-04-05, 17:01
RE: Json Call to remote instance - by djon - 2013-02-23, 22:50
RE: Json Call to remote instance - by pkscout - 2013-02-23, 23:31
RE: Json Call to remote instance - by djon - 2013-02-24, 09:49
RE: Json Call to remote instance - by djon - 2013-02-24, 10:02
Logout Mark Read Team Forum Stats Members Help
Json Call to remote instance0