PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of martin barker  >  PHP JSON RPC Objective Server  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: example script showing how to test the serevr
Class: PHP JSON RPC Objective Server
Handle API requests to a JSON RPC server
Author: By
Last change:
Date: 6 years ago
Size: 443 bytes


Class file image Download
// 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":"", "params":["hello world"], "id":0}' );
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/plain'));

$result=curl_exec ($ch);

For more information send a message to info at phpclasses dot org.