<?php
// works
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://serverurl/" );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"jsonrpc":"2.0", "method":"example.ping", "params":["hello world"], "id":0}' );
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/plain'));
$result=curl_exec ($ch);
echo $result;
|