PHP Classes

How to use JSONRPC 2.0?

Recommend this page to a friend!

      REST Client  >  All threads  >  How to use JSONRPC 2.0?  >  (Un) Subscribe thread alerts  
Subject:How to use JSONRPC 2.0?
Summary:REST Client to use JSONRPC 2.0?
Messages:2
Author:realjobe
Date:2012-04-12 15:22:38
Update:2012-04-12 15:40:50
 

  1. How to use JSONRPC 2.0?   Reply   Report abuse  
Picture of realjobe realjobe - 2012-04-12 15:22:38
Hi there.
GREAT class, but I'm having trouble using it.
My JsonRPC call (post) is

URL = http://192.168.0.250:81/jsonrpc
JsonRPC = { "jsonrpc": "2.0", "method": "JSONRPC.Ping", "id": 1 }

How to make the call?

This does not work:


$ex = RestClient::post($url,"{ 'jsonrpc': '2.0', 'method': 'JSONRPC.Ping', 'id': '1 }",$user,$password,"application/json");



  2. Re: How to use JSONRPC 2.0?   Reply   Report abuse  
Picture of realjobe realjobe - 2012-04-12 15:40:50 - In reply to message 1 from realjobe
Well.. This works. No a beatiful, but works

$ping = RestClient::post("http://192.168.0.250:81/jsonrpc","{ \"jsonrpc\": \"2.0\", \"method\": \"JSONRPC.Ping\", \"id\": 1